Test methods are static Apex code methods, annotated with
@isTest. They are written within an outer class, also annotated with
@isTest. Tests are subject to the same governor limits as all Apex code, but every test method is completely independent for the purposes of limit tracking, not cumulative. Also, test classes are not counted against the code size limit for a Force.com organization.
A test is considered successful if its method is executed without encountering an uncaught exception. A common testing pattern is to make a series of assertions about the target code’s state using the built-in method
System.assert. The argument of
assert is a Boolean expression. If it evaluates to
true, the program continues; otherwise, a