March 2015
Beginner to intermediate
274 pages
6h 1m
English
Assertions are methods that check for a condition that can be evaluated. If the condition is not met, the assertion method will throw an exception, thereby aborting the execution of the test.
The JUnit API includes the class Assert. This is the base class of all the TestCase classes that hold several assertion methods useful for writing tests. These inherited methods test for a variety of conditions and are overloaded to support different parameter types. They can be grouped together in the following different sets, depending on the condition checked, for example:
The condition tested is pretty obvious and is easily identifiable by the method name. ...
Read now
Unlock full access