T4S4  19.1 C8540 A23673
Teamcenter Gateway for SAP S/4HANA API Reference
T4X::TestingSupport::Assert Namespace Reference

Commands to compare expected with actual results. They must only be called from within verify procedures. Call them without any namespace identifier. More...

Functions

 assertDiffers unExpected actual ?prefix?
 Assert that two values are not equal. More...
 
 assertEQ expected actual ?prefix?
 Assert that two values are equal. More...
 
 assertEquals expected actual ?prefix?
 Assert that two values are equal. More...
 
 assertErrorCode errorCode ?prefix?
 Assert that the error that was raised in the bad section of the test issues the given error code. More...
 
 assertErrorInfo errorInfo ?prefix?
 Assert that the error that was raised in the bad section of the test issues the given error info. More...
 
 assertErrorMessage errorMessage ?prefix?
 Assert that the error that was raised in the bad section of the test issues the given error message. More...
 
 assertErrorRaised ?prefix?
 Asserts that an error was raised in the bad section of the demo case. More...
 
 assertFalse expression ?prefix?
 Assert that an expression evaluates to false. More...
 
 assertNE unExpected actual ?prefix?
 Assert that two values are not equal. More...
 
 assertTextFilesEqual args
 Assert that the contents of two files are equal assuming they contain text. More...
 
 assertTrue expression ?prefix?
 Assert that an expression evaluates to true. More...
 

Detailed Description

Commands to compare expected with actual results. They must only be called from within verify procedures. Call them without any namespace identifier.

Deprecated:
Please use the namespace T4X::TNT::Assert instead.

Function Documentation

◆ assertDiffers()

T4X::TestingSupport::Assert::assertDiffers   unExpected actual ?prefix?  

Assert that two values are not equal.

Deprecated:
Please use T4X::TNT::Assert::assertDiffers instead.

If they are, an error is raised with errorCode being {ASSERT DIFFERS}.

This command may only be called inside verify sections and the error caught by the testing framework.

Comparison is performed using the == operator.

Parameters
unExpectedthe value from which the actual value must differ to fulfill the assertion
actualthe actual value
prefix(optional) string prefixing the line added to the test report

◆ assertEQ()

T4X::TestingSupport::Assert::assertEQ   expected actual ?prefix?  

Assert that two values are equal.

Deprecated:
Please use T4X::TNT::Assert::assertEQ instead.

If they are not, an error is raised with errorCode being {ASSERT EQUALS}.

This command may only be called inside verify sections and the error caught by the testing framework.

Comparison is performed using the ne operator.

Parameters
expectedthe expected value
actualthe actual value
prefix(optional) string prefixing the line added to the test report

◆ assertEquals()

T4X::TestingSupport::Assert::assertEquals   expected actual ?prefix?  

Assert that two values are equal.

Deprecated:
Please use T4X::TNT::Assert::assertEquals instead.

If they are not, an error is raised with errorCode being {ASSERT EQUALS}.

This command may only be called inside verify sections and the error caught by the testing framework.

Comparison is performed using the != operator.

Parameters
expectedthe expected value
actualthe actual value
prefixoptional string prefixing the line added to the test report

◆ assertErrorCode()

T4X::TestingSupport::Assert::assertErrorCode   errorCode ?prefix?  

Assert that the error that was raised in the bad section of the test issues the given error code.

Deprecated:
Please use T4X::TNT::Assert::assertErrorCode instead.

If not, an error is raised with errorCode being {ASSERT ERROR_CODE}.

This command may only be called inside verify sections and the error caught by the testing framework.

Parameters
errorCodethe expected error code
prefix(optional) string prefixing the line added to the test report; Defaults to "Comparison Failure".

◆ assertErrorInfo()

T4X::TestingSupport::Assert::assertErrorInfo   errorInfo ?prefix?  

Assert that the error that was raised in the bad section of the test issues the given error info.

Deprecated:
Please use T4X::TNT::Assert::assertErrorInfo instead.

If not, an error is raised with errorCode being {ASSERT ERROR_INFO}.

This command may only be called inside verify sections and the error caught by the testing framework.

Parameters
errorInfothe expected error info
prefix(optional) string prefixing the line added to the test report; Defaults to "Comparison Failure".

◆ assertErrorMessage()

T4X::TestingSupport::Assert::assertErrorMessage   errorMessage ?prefix?  

Assert that the error that was raised in the bad section of the test issues the given error message.

Deprecated:
Please use T4X::TNT::Assert::assertErrorMessage instead.

If not, an error is raised with errorCode being {ASSERT ERROR_MESSAGE}.

This command may only be called inside verify sections and the error caught by the testing framework.

Parameters
errorMessagethe expected error message
prefix(optional) string prefixing the line added to the test report; Defaults to "Comparison Failure".

◆ assertErrorRaised()

T4X::TestingSupport::Assert::assertErrorRaised   ?prefix?  

Asserts that an error was raised in the bad section of the demo case.

Deprecated:
Please use T4X::TNT::Assert::assertErrorRaised instead.

If not, an error is raised with errorCode being {ASSERT ERROR_RAISED}.

This command may only be called inside verify sections and the error caught by the testing framework.

Parameters
prefix(optional) string prefixing the line added to the test report; Defaults to "Assertion Error".

◆ assertFalse()

T4X::TestingSupport::Assert::assertFalse   expression ?prefix?  

Assert that an expression evaluates to false.

Deprecated:
Please use T4X::TNT::Assert::assertFalse instead.

If not, an error is raised with errorCode being {ASSERT FALSE}.

This command may only be called inside verify sections and the error caught by the testing framework.

Parameters
expressionto be evaluated
prefix(optional) string prefixing the line added to the test report; Defaults to "Assertion Error"

◆ assertNE()

T4X::TestingSupport::Assert::assertNE   unExpected actual ?prefix?  

Assert that two values are not equal.

Deprecated:
Please use T4X::TNT::Assert::assertNE instead.

If they are, an error is raised with errorCode being {ASSERT DIFFERS}.

This command may only be called inside verify sections and the error caught by the testing framework.

Comparison is performed using the eq operator.

Parameters
unExpectedthe value from which the actual value must differ to fulfill the assertion
actualthe actual value
prefix(optional) string prefixing the line added to the test report; Defaults to "Comparison Failure".

◆ assertTextFilesEqual()

T4X::TestingSupport::Assert::assertTextFilesEqual   args  

Assert that the contents of two files are equal assuming they contain text.

Deprecated:
Please use T4X::TNT::Assert::assertTextFilesEqual instead.

If they are not, an error is raised with errorCode being {ASSERT TEXT_FILES_EQUAL}.

This command may only be called inside verify sections and the error caught by the testing framework.

Comparison is performed by applying the eq operator to the contents of both files.

The -ignore option allows to specify regular expressions to be ignore during comparison. This is typically used to mask out generated data that changes with each test run.

Parameters
expectedthe name of the file as it should be
actualthe name of the file as it actually comes out of the test
prefix(optional) string prefixing the line added to the test report
-ignoreREGEXP (optional) regular expression with at least one parenthesized expression to be ignored when comparing the lines of the files

◆ assertTrue()

T4X::TestingSupport::Assert::assertTrue   expression ?prefix?  

Assert that an expression evaluates to true.

Deprecated:
Please use T4X::TNT::Assert::assertTrue instead.

If not, an error is raised with errorCode being {ASSERT TRUE}.

This command may only be called inside verify sections and the error caught by the testing framework.

Parameters
expressionto be evaluated
prefix(optional) string prefixing the line added to the test report; Defaults to "Assertion Error"