Skip to main content

Utf16StringAssertions

Short summary

This class provides assert statements for UTF-16 strings until 255 WORD length

AccessAbstractFinalExtendsImplements
INTERNALNoNoAbstractAssertionIUtf16StringAssertions

UML Diagram

Parameters

none

Properties

className

Type: CNM_AbstractObject.ClassName

This abstract property returns the class name of the concrete object,

Methods

contains

  • Parameters:
    • stringToCheck (( Tc2_System.MAX_STRING_LENGTH )): current string to check
    • searchString (( Tc2_System.MAX_STRING_LENGTH )): string must be found in stringToCheck
    • message (AssertMessage): message if the assertion is false
    • ignoreCases (BOOL): TRUE means ignore cases; FALSE means cases must be equal too
    • normalizeStrings (BOOL): normalize both strings for check
  • Return type: VOID

This assertion method for UTF-16 strings checks if the current string stringToCheck

containsNo

  • Parameters:
    • stringToCheck (( Tc2_System.MAX_STRING_LENGTH )): current string to check
    • searchString (( Tc2_System.MAX_STRING_LENGTH )): string that must not be found in stringToCheck
    • message (AssertMessage): message if the assertion is false
    • ignoreCases (BOOL): TRUE means ignore cases; FALSE means cases must be equal too
    • normalizeStrings (BOOL): normalize both strings for check
  • Return type: VOID

This assertion method for UTF-16 strings checks if the current string stringToCheck contains not the search string searchString

endsWith

  • Parameters:
    • stringToCheck (( Tc2_System.MAX_STRING_LENGTH )): current string to check
    • end (( Tc2_System.MAX_STRING_LENGTH )): expected end of stringToCheck
    • message (AssertMessage): message if the assertion is false
    • ignoreCases (BOOL): TRUE means ignore cases; FALSE means cases must be equal too
    • trim (BOOL): TRUE means truncation of white-space on the right side of stringToCheck
    • normalizeStrings (BOOL): normalize both strings for check
  • Return type: VOID

This assertion method for UTF-16 strings checks if the current string stringToCheck ends with the string end

isEmpty

  • Parameters:
    • stringToCheck (( Tc2_System.MAX_STRING_LENGTH )): current string to check
    • message (AssertMessage): message if the assertion is false
  • Return type: VOID

This assertion method checks if the current string stringToCheck is empty

isEqualTo

  • Parameters:
    • stringToCheck (( Tc2_System.MAX_STRING_LENGTH )): current string to check
    • expected (( Tc2_System.MAX_STRING_LENGTH )): stringToCheck must be equal to expected
    • message (AssertMessage): message if the assertion is false
    • ignoreCases (BOOL): TRUE means ignore cases; FALSE means cases must be equal too
    • normalizeStrings (BOOL): normalize both strings for check
  • Return type: VOID

This assertion method checks if the current string stringToCheck is equal to expected

isNotEmpty

  • Parameters:
    • stringToCheck (( Tc2_System.MAX_STRING_LENGTH )): current string to check
    • message (AssertMessage): message if the assertion is false
  • Return type: VOID

This assertion method checks if the current string stringToCheck is not empty

isNotEqualTo

  • Parameters:
    • stringToCheck (( Tc2_System.MAX_STRING_LENGTH )): current string to check
    • unexpected (( Tc2_System.MAX_STRING_LENGTH )): stringToCheck must be not equal to expected
    • message (AssertMessage): message if the assertion is false
    • ignoreCases (BOOL): TRUE means ignore cases; FALSE means cases must be equal too
    • normalizeStrings (BOOL): normalize both strings for check
  • Return type: VOID

This assertion method checks if the current string stringToCheck is not equal to unexpected

lengthIsBetween

  • Parameters:
    • stringToCheck (( Tc2_System.MAX_STRING_LENGTH )): current string to check
    • minLength (USINT): lower limit of the string length
    • maxLength (USINT): upper limit of the string length
    • stringLengthUnit (UnicodeStringLengthUnit): string length units of measurement
    • message (AssertMessage): message if the assertion is false
  • Return type: VOID

This assertion method checks if the current string stringToCheck length

lengthIsExact

  • Parameters:
    • stringToCheck (( Tc2_System.MAX_STRING_LENGTH )): current string to check
    • expectedLength (USINT): expected length of stringToCheck
    • stringLengthUnit (UnicodeStringLengthUnit): string length units of measurement
    • message (AssertMessage): message if the assertion is false
  • Return type: VOID

This assertion method checks if the current string stringToCheck length

lengthIsMax

  • Parameters:
    • stringToCheck (( Tc2_System.MAX_STRING_LENGTH )): current string to check
    • maxLength (USINT): upper limit of the length of stringToCheck
    • stringLengthUnit (UnicodeStringLengthUnit): string length units of measurement
    • message (AssertMessage): message if the assertion is false
  • Return type: VOID

This assertion method checks if the current string stringToCheck length

lengthIsMin

  • Parameters:
    • stringToCheck (( Tc2_System.MAX_STRING_LENGTH )): current string to check
    • minLength (USINT): lower limit of the length of stringToCheck
    • stringLengthUnit (UnicodeStringLengthUnit): string length units of measurement
    • message (AssertMessage): message if the assertion is false
  • Return type: VOID

This assertion method checks if the current string stringToCheck length

setCallBack

  • Parameters:
    • callBack (IAssertCallBack): the class that must be informed if an assertion is false
  • Return type: VOID

This methods is the setter for the callback class if an assertion was false

startsWith

  • Parameters:
    • stringToCheck (( Tc2_System.MAX_STRING_LENGTH )): current string to check
    • start (( Tc2_System.MAX_STRING_LENGTH )): expected start of stringToCheck
    • message (AssertMessage): message if the assertion is false
    • ignoreCases (BOOL): TRUE means ignore cases; FALSE means cases must be equal too
    • trim (BOOL): TRUE means truncation of white-space on the left side of stringToCheck
    • normalizeStrings (BOOL): normalize both strings for check
  • Return type: VOID

This assertion method checks if the current string stringToCheck starts with start

Code

Declaration

{attribute 'reflection'}
FUNCTION_BLOCK INTERNAL Utf16StringAssertions EXTENDS AbstractAssertion IMPLEMENTS IUtf16StringAssertions
VAR
(* class to handle the UTF-16 string assertions *)
assertion :Utf16StringPointerAssertions();
END_VAR