Skip to main content

Dialog: Add Unit Test Assertion

Function: The dialog adds an assert function for any data type, for example for a user-defined data type.

Call:

  • Project → Add Object → Unit Test Assertion menu

  • Context menu of the application → Add Object → Unit Test Assertion

Setting

Description

Name of assertion

Name of the assert function. The Test Manager generates the name automatically from the data type and the type of the assertion. You cannot change the name here.

Scheme: Assert_<Datentyp>_<Typ der Assertion>; for array-based: Assert_ArrayOf<Datentyp>_<Typ der Assertion>. Spaces in the data type are omitted.

Data type

Data type for which you create the assert function. The entry is required.

Click the _tm_icon____.png button to open the Input Assistant for standard data types and structured data types.

Type of assertion

Name of the check, for example Equal. The entry is required. The name becomes part of the name of the assert function. You implement the check logic yourself.

Table 91. Implementation

Setting

Description

Type

Value-based: Creates an assert function for single values of the data type. Inputs: referenceValue, actualValue

Array-based: Creates an assert function for arrays of the data type. Inputs/outputs: referenceArray, actualArray

Add implementation template

Inserts a sample implementation which checks the reference value and the actual value for equality. A compiler warning reminds you to adapt the implementation to the type of the assertion. You must not change the lines with the comment // mandatory - don't change.

Add explanatory comments

Inserts a comment in the declaration part which explains the pattern of an assert function.



For more information, see the following: Assert Functions, Add Unit Test