SysTestAssert Class [AX 2012]
The SysTestAssert class contains the predefined assertion methods for the Unit Test framework.
Syntax
class SysTestAssert
Run On
Called
Methods
Method | Description | |
---|---|---|
assertEquals | Checks whether two values are equal. | |
assertFalse | Checks whether a condition is not true. | |
assertNotEqual | Checks whether two values are not equal. | |
assertNotNull | Checks whether the value is not nullNothingnullptrunita null reference (Nothing in Visual Basic). | |
assertNotSame | Checks whether the objects are not the same. | |
assertNull | Checks whether the value is nullNothingnullptrunita null reference (Nothing in Visual Basic). | |
assertObjectEquals | Checks whether the objects are equal. | |
assertRealEquals | Checks whether two values are equal with regard to a delta. | |
assertSame | Checks whether the objects are the same. | |
assertTrue | Checks whether the condition is true. | |
cancelTimeOut | Cancels a previous method call to the setTimeOut method. (Inherited from Object.) | |
comparisonFail | Converts two values to strings to provide a message when a comparison fails. | |
convert2str | Converts an anytype value into a string value. | |
equal | Determines whether the specified object is equal to the current one. (Inherited from Object.) | |
fail | Fails the current test case. | |
getTimeOutTimerHandle | Returns the timer handle for the object. (Inherited from Object.) | |
handle | Retrieves the handle of the class of the object. (Inherited from Object.) | |
info | Logs an informational message to the Infolog. | |
isEqual | Checks whether two values are equal. | |
new | Initializes a new instance of the SysTestAssert class. | |
notify | Releases the hold on an object that has called the wait method on this object. (Inherited from Object.) | |
notifyAll | Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.) | |
objectOnServer | Determines whether the object is on a server. (Inherited from Object.) | |
owner | Returns the instance that owns the object. (Inherited from Object.) | |
setTimeOut | Sets up the scheduled execution of a specified method. (Inherited from Object.) | |
toString | Returns a string that represents the current object. (Inherited from Object.) | |
usageCount | Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.) | |
wait | Pauses a process. (Inherited from Object.) | |
xml | Returns an XML string that represents the current object. (Inherited from Object.) | |
::assert | For internal use. | |
::logMessage | For internal use. | |
::message | For internal use. |
Top
Remarks
The SysTestCase class extends the SysTestAssert class. To use the methods defined in the SysTestAssert class, create a class that extends the SysTestCase class and then add a method. In the method, you can use any of the assertion methods for your testing needs. For an example of how to use an assertion method, see How to: Create a Test Case.
Messages are only displayed when a test fails.
Inheritance Hierarchy
Object Class
SysTestAssert Class
SysTestCase Class