October 2018
Beginner to intermediate
466 pages
12h 2m
English
The general layout of a test case is to set certain variables to known values, run one or more functions, methods, or processes, and then prove that correct expected results were returned or calculated by using TestCase assertion methods.
There are a few different assertion methods available to confirm that specific results have been achieved. We just saw assertEqual, which will cause a test failure if the two parameters do not pass an equality check. The inverse, assertNotEqual, will fail if the two parameters do compare as equal. The assertTrue and assertFalse methods each accept a single expression, and fail if the expression does not pass an if test. These tests do not check for the Boolean values True or False. Rather, ...