Asserts are subroutines that are called within a test to validate the results of the test. Ideally, there should be one assert per test.
Eight Assert functions are defined:
AssertTRUE(Condition, Comment)
AssertFALSE(Condition, Comment)
AssertEqual(Expected_Value, Actual_Value, Comment, Tolerance)
AssertNotEqual(Expected_Value, Actual_Value, Comment)
AssertGreater(Expected_Value, Actual_Value, Comment)
AssertGreaterEqual(Expected_Value, Actual_Value, Comment)
AssertLess(Expected_Value, Actual_Value, Comment)
AssertLessEqual(Expected_Value, Actual_Value, Comment)
The parameters are:
Condition: Boolean condition determining pass/fail state of the test. Invalid is considered a failure
Comment: Brief comment to help identify the source of a failure
Expected_Value: Typically a constant that defines what the expected value should have been
Actual_Value: Value observed during the test
Tolerance: Maximum allowable difference between Expected_Value and Actual_Value for equivalence test of numbers. Defaults to 0.
If the condition asserted by the call is true, then the Assert has passed and no failure will be recorded. All Asserts for a test must pass in order for the test to pass.