Skip to main content

IUnicodeStringAssertions

Short summary​

the interface provides assert statements for UTF-8 and UTF-16 strings with an undefined length. It accepts anystrings, strings are processed as UTF8 and wstrings are processed as UTF16

Attention: All strings are handled as null terminated byte/word streams. For UTF8 is end of the string 16#00 For UTF-16 is end of the string 16#00_00

Attention: The interface IUnicodeStringAssertions uses ANY_STRING, for this it's not possible to use literals/constants, because for ANY types generates the compiler __SYSTEM.AnyType and __SYSTEM.AnyType contains a pointer

AccessAbstractFinalExtendsImplements
-NoNo__SYSTEM.IQueryInterface-

UML Diagram​

Methods​

contains​

  • Parameters:
    • stringToCheck (ANY_STRING): current string to check
    • searchString (ANY_STRING): 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 checks if the current string stringToCheck contains the search string…

containsNo​

  • Parameters:
    • stringToCheck (ANY_STRING): current string to check
    • searchString (ANY_STRING): 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 checks if the current string stringToCheck not contains the search string…

endsWith​

  • Parameters:
    • stringToCheck (ANY_STRING): current string to check
    • end (ANY_STRING): 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 spaces on the right side of stringToCheck
    • normalizeStrings (BOOL): normalize both strings for check
  • Return type: VOID

This assertion method checks if the current string stringToCheck ends with end…

isEmpty​

  • Parameters:
    • stringToCheck (ANY_STRING): 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 (ANY_STRING): current string to check
    • expected (ANY_STRING): 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 (ANY_STRING): 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 (ANY_STRING): current string to check
    • unexpected (ANY_STRING): 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 (ANY_STRING): current string to check
    • minLength (UDINT): lower limit of the string length
    • maxLength (UDINT): 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 is length…

lengthIsExact​

  • Parameters:
    • stringToCheck (ANY_STRING): current string to check
    • expectedLength (UDINT): 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 is length…

lengthIsMax​

  • Parameters:
    • stringToCheck (ANY_STRING): current string to check
    • maxLength (UDINT): 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 is length…

lengthIsMin​

  • Parameters:
    • stringToCheck (ANY_STRING): current string to check
    • minLength (UDINT): 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 is length…

startsWith​

  • Parameters:
    • stringToCheck (ANY_STRING): current string to check
    • start (ANY_STRING): 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 spaces 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​

INTERFACE IUnicodeStringAssertions EXTENDS __SYSTEM.IQueryInterface