lengthIsExact
Short summary
This assertion method checks if the current string stringToCheck length is equal to expectedLength.
Processed strings must be in UTF-8 encoding
Parameters
| Name | Type | Comment | Kind |
|---|---|---|---|
| stringToCheck | Tc2_System.T_MaxString | current string to check | input |
| expectedLength | USINT | expected length of stringToCheck | input |
| stringLengthUnit | UnicodeStringLengthUnit | string length units of measurement | input |
| message | AssertMessage | message if the assertion is false | input |
Code
Declaration
METHOD lengthIsExact
VAR_INPUT
(* current string to check *)
{attribute 'TcEncoding' := 'UTF-8'}
stringToCheck :Tc2_System.T_MaxString;
(* expected length of ``stringToCheck`` *)
expectedLength :USINT;
(* string length units of measurement *)
stringLengthUnit :UnicodeStringLengthUnit;
(* message if the assertion is false *)
message :AssertMessage;
END_VAR
Implementation
THIS^.assertion.lengthIsExact(
stringToCheck := ADR(stringToCheck),
expectedLength := expectedLength,
stringLengthUnit := stringLengthUnit,
message := message
);