You need to sign in to do that
Don't have an account?
Srinivas
Test Methodd
public static void logError(Exception ex)
{
Contact errorLog = new Contact ();
errorLog.MailingAddress='Errorlog@gmail.com';
errorLog.Name='Record Updation';
Database.insert(errorLog , false);
}
Can Any one help test method for this
I have created a test class as below and it covered 100%. Just replace logErrorclass with your class in which the above method is present.
If this solution helps, please mark it as best answer.
Thanks,
Just remember that a good test class doesn't cover just code coverage, but also use case coverage. Always add assertions to make sure the method/process is behaving as expected.