T4S4  19.1 C8540 A23673
Teamcenter Gateway for SAP S/4HANA API Reference
T4X::TNT::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

 assertContains list item ?prefix?
 Assert that a list contains an item. More...
 
 assertContainsNot list item ?prefix?
 Assert that a list does not contain an item. More...
 
 assertDiffers unexpected actual ?prefix?
 Assert that two values are not equal. More...
 
 assertDoneWithin maximumElapsed ?prefix?
 Assert that the execution finished within the given amount of time. 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...
 
 assertNotSubstring string substring ?prefix?
 Assert that a string does not contain a substring. More...
 
 assertSubstring string substring ?prefix?
 Assert that a string contains a substring. More...
 
 assertSucceeded testResultsIn ?prefix?
 Assert that the delegated execution of a demo suite succeeded. More...
 
 assertTextFilesDiffer args
 Assert that the contents of two files differ assuming they contain text. 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.

Function Documentation

◆ assertContains()

T4X::TNT::Assert::assertContains   list item ?prefix?  

Assert that a list contains an item.

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

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

Parameters
listto be searched for the item
itemto be searched in the list
prefix(optional) string prefixing the line added to the test report; Defaults to "Assertion Error"

◆ assertContainsNot()

T4X::TNT::Assert::assertContainsNot   list item ?prefix?  

Assert that a list does not contain an item.

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

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

Parameters
listto be searched for the item
itemto be searched in the list
prefix(optional) string prefixing the line added to the test report; Defaults to "Assertion Error"

◆ assertDiffers()

T4X::TNT::Assert::assertDiffers   unexpected actual ?prefix?  

Assert that two values are not equal.

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

◆ assertDoneWithin()

T4X::TNT::Assert::assertDoneWithin   maximumElapsed ?prefix?  

Assert that the execution finished within the given amount of time.

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

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

Note that it does not stop execution when the maximum allowed duration exceeds.

Parameters
maximumElapseda floating point number denoting the maximum allowed duration in seconds
refix(optional) string prefixing the line added to the test report; Defaults to "Timeout Failure".

◆ assertEQ()

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

Assert that two values are equal.

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::TNT::Assert::assertEquals   expected actual ?prefix?  

Assert that two values are equal.

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::TNT::Assert::assertErrorCode   errorCode ?prefix?  

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

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::TNT::Assert::assertErrorInfo   errorInfo ?prefix?  

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

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::TNT::Assert::assertErrorMessage   errorMessage ?prefix?  

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

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::TNT::Assert::assertErrorRaised   ?prefix?  

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

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::TNT::Assert::assertFalse   expression ?prefix?  

Assert that an expression evaluates to false.

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::TNT::Assert::assertNE   unexpected actual ?prefix?  

Assert that two values are not equal.

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".

◆ assertNotSubstring()

T4X::TNT::Assert::assertNotSubstring   string substring ?prefix?  

Assert that a string does not contain a substring.

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

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

Parameters
stringto be searched for the substring
substringto be searched in the string
prefix(optional) string prefixing the line added to the test report; Defaults to "Assertion Error"

◆ assertSubstring()

T4X::TNT::Assert::assertSubstring   string substring ?prefix?  

Assert that a string contains a substring.

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

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

Parameters
stringto be searched for the substring
substringto be searched in the string
prefix(optional) string prefixing the line added to the test report; Defaults to "Assertion Error"

◆ assertSucceeded()

T4X::TNT::Assert::assertSucceeded   testResultsIn ?prefix?  

Assert that the delegated execution of a demo suite succeeded.

If it didn't, an error is raised with errorCode being {ASSERT SUCCEEDED}.

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

Parameters
testResultsInthe name of the Tcl array resulting from the delegated execution
prefixoptional string prefixing the line added to the test report

◆ assertTextFilesDiffer()

T4X::TNT::Assert::assertTextFilesDiffer   args  

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

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

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 not 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

◆ assertTextFilesEqual()

T4X::TNT::Assert::assertTextFilesEqual   args  

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

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::TNT::Assert::assertTrue   expression ?prefix?  

Assert that an expression evaluates to true.

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"