assertEquals()
Evaluates two expressions to be equal as true, and reports a failure
if FALSE
.
Syntax
assertEquals(
valueA STRING,
valueB STRING,
msg STRING )
- valueA is the first value to test.
- valueB is the second value to check against valueA.
- msg is the error message to report if the expression is
FALSE
. Only failed assertions are reported.
Usage
Use assertEquals()
to check two values, an expected value and an actual value,
and test if they are equal. If they are not, the GGC marks the check as failed in the resulting
report.
In this example an expected field value in the tested application should be "Wall clock". If the result is not valid, an explanatory error message is generated for the test report. (Line breaks have been added to the command example to improve readability.)
CALL ggc.assertEquals(ggc.getFieldValue("formonly.name"), "Wall clock",
SFMT("Field value is not valid, expected: 'Wall clock', got: '%1'", ggc.getFieldValue("formonly.name")))