assertEqualsMsg

assertEqualsMsg(message:  String;
                expected: Any;
                actual:   Any);

The assertEqualsMsg method of the JadeTestCase class is invoked by a user test method to compare the result of the test, represented by the value of the actual parameter, with the expected result represented by the value of the expected parameter.

If the test fails, indicated by the values of the expected and actual parameters being different, a message is generated in the following format.

assertEqualsMsg - expected m but actual = n

The following code example shows the use of the assertEqualsMsg method in a user test method.

add() unitTest;
begin
    calculator.add(1);
    calculator.add(1);
    assertEqualsMsg("Addition error", 2, calculator.getResult());
end;

A failure in the test method results in the testFailure method being executed by an object implementing the JadeTestListenerIF interface. For details, see "Using the JADE Testing Framework", in Chapter 17 of the JADE Developer’s Reference.