Assert

The Assert method can be used to indicate that the current test case has failed. Unlike the AssertEqual method, which compares the result to the expected value on its own, the comparison here must be performed in the test case’s application code, and the result of the comparison must be passed to the method as a Boolean value. The error message is passed in the sMessage parameter.
Syntax
METHOD PUBLIC FINAL Assert
VAR_INPUT
bCondition : BOOL
sMessage : STRING
END_VAR
Inputs
Name | Type | Description |
|---|---|---|
bCondition | BOOL | A BOOL value that indicates whether the test was successful. |
sMessage | STRING(255) | Error message to be passed |
Sample
Assert(bCondition:=<condition>,sMessage:=' Error message to be displayed in the client!');