|
|
|
Here’s a list of
some of the components needed for the tests.
|
|
|
|
In the example
there really isn’t a fixture, since there are only class methods and no
variables. If you were testing sets,
an example would be the empty set or the set of even numbers less than 100.
|
|
|
|
The test case in
the example is really the collection of maximum values 0, 2, 3, and 100.
|
|
|
|
Results are
often checked with assertion statements.
In Java there is an assertEquals method, but Smalltalk often uses
should: and shouldnt:
|
|
|
|
Lastly, tests
can be grouped together into test suites.
In this example, the test suite is generated automatically using
language reflection capabilities, but it is also possible to make suites in
code.
|