August 2010
Intermediate to advanced
1224 pages
34h 17m
English
The UnitTesting namespace also includes the Assert static type. This object contains methods for evaluating whether the results of a test were as expected. You call these static methods and expect a true/false condition. If the boolean condition fails, the assertion fails. The assertions do not actually return results. Rather, they automatically notify the unit test framework at runtime if the assertion fails or succeeds.
As an example, you might write a unit test to load a known record from the database. You would then write assertions about this known record to prove that you can retrieve the data from the database and properly call the right sets and gets on a specific object. The following shows a simple assertion for testing ...