assertEquals()

Evaluates two expressions to be equal as true, and reports a failure if FALSE.

Syntax

assertEquals(
    valueA STRING,
    valueB STRING,
    msg STRING )
  1. valueA is the first value to test.
  2. valueB is the second value to check against valueA.
  3. 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 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")))