AssertNotEqual

AssertNotEqual 1:

The AssertNotEqual method can be used to check whether the result of a test case does not match an expected value. If this is not the case, an error message is passed. The AssertEqual method is based on the ANY data type. Since the parameters must be passed as typed values for this reason, the expected value must first be assigned to a corresponding typed variable and cannot be assigned directly within the call to the AssertEqual method

Syntax

METHOD PUBLIC AssertNotEqual
VAR_INPUT
    anyActual :    ANY;
    anyExpected :  ANY;
    sMessage : STRING(255) := ''; // optional assert message
END_VAR

AssertNotEqual 2: Inputs

Name

Type

Description

anyActual

ANY

Value determined by executing the test case

anyExpected

ANY

Expected value for the test case

sMessage

STRING(255)

Error message if the test fails.

Sample

expectedValue:=<value>;
AssertNotEqual(anyActual:=<actual Value>, anyExpected:= <expectedValue>, message:= 'Error message to be displayed in the client!');