You need to sign in to do that
Don't have an account?

what is the use of system.assert() system.assertEquals()
I am not undestanding where we use system.assert() and system.assertEquals() and how it is working
please give me explanation with an example
You can use system.assert to evaluate any type of condition. Where as system.assertEquals enforce "Equals" condition.
What happens when the condition is fails
please give me explanation with an example
When the conditions fails, a test failure will occur and will not execute the test code written after your system.assert() statement. The potential results of the failure of a system.assert() are Deployment failure and loss of test coverage.
String myString2 = 'abcd';
Integer result =
myString1.compareTo(myString2);
System.assertEquals(result, 1);
try dis xmpl