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
Gg933800.pubmethod(en-us,AX.60).gif assertEquals Checks whether two values are equal.
Gg933800.pubmethod(en-us,AX.60).gif assertFalse Checks whether a condition is not true.
Gg933800.pubmethod(en-us,AX.60).gif assertNotEqual Checks whether two values are not equal.
Gg933800.pubmethod(en-us,AX.60).gif assertNotNull Checks whether the value is not nullNothingnullptrunita null reference (Nothing in Visual Basic).
Gg933800.pubmethod(en-us,AX.60).gif assertNotSame Checks whether the objects are not the same.
Gg933800.pubmethod(en-us,AX.60).gif assertNull Checks whether the value is nullNothingnullptrunita null reference (Nothing in Visual Basic).
Gg933800.privmethod(en-us,AX.60).gif assertObjectEquals Checks whether the objects are equal.
Gg933800.pubmethod(en-us,AX.60).gif assertRealEquals Checks whether two values are equal with regard to a delta.
Gg933800.pubmethod(en-us,AX.60).gif assertSame Checks whether the objects are the same.
Gg933800.pubmethod(en-us,AX.60).gif assertTrue Checks whether the condition is true.
Gg933800.pubmethod(en-us,AX.60).gif cancelTimeOut Cancels a previous method call to the setTimeOut method. (Inherited from Object.)
Gg933800.privmethod(en-us,AX.60).gif comparisonFail Converts two values to strings to provide a message when a comparison fails.
Gg933800.privmethod(en-us,AX.60).gif convert2str Converts an anytype value into a string value.
Gg933800.pubmethod(en-us,AX.60).gif equal Determines whether the specified object is equal to the current one. (Inherited from Object.)
Gg933800.pubmethod(en-us,AX.60).gif fail Fails the current test case.
Gg933800.pubmethod(en-us,AX.60).gif getTimeOutTimerHandle Returns the timer handle for the object. (Inherited from Object.)
Gg933800.pubmethod(en-us,AX.60).gif handle Retrieves the handle of the class of the object. (Inherited from Object.)
Gg933800.pubmethod(en-us,AX.60).gif info Logs an informational message to the Infolog.
Gg933800.privmethod(en-us,AX.60).gif isEqual Checks whether two values are equal.
Gg933800.pubmethod(en-us,AX.60).gif new Initializes a new instance of the SysTestAssert class.
Gg933800.pubmethod(en-us,AX.60).gif notify Releases the hold on an object that has called the wait method on this object. (Inherited from Object.)
Gg933800.pubmethod(en-us,AX.60).gif notifyAll Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.)
Gg933800.pubmethod(en-us,AX.60).gif objectOnServer Determines whether the object is on a server. (Inherited from Object.)
Gg933800.pubmethod(en-us,AX.60).gif owner Returns the instance that owns the object. (Inherited from Object.)
Gg933800.pubmethod(en-us,AX.60).gif setTimeOut Sets up the scheduled execution of a specified method. (Inherited from Object.)
Gg933800.pubmethod(en-us,AX.60).gif toString Returns a string that represents the current object. (Inherited from Object.)
Gg933800.pubmethod(en-us,AX.60).gif usageCount Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.)
Gg933800.pubmethod(en-us,AX.60).gif wait Pauses a process. (Inherited from Object.)
Gg933800.pubmethod(en-us,AX.60).gif xml Returns an XML string that represents the current object. (Inherited from Object.)
Gg933800.pubmethod(en-us,AX.60).gif Gg933800.static(en-us,AX.60).gif ::assert For internal use.
Gg933800.privmethod(en-us,AX.60).gif Gg933800.static(en-us,AX.60).gif ::logMessage For internal use.
Gg933800.pubmethod(en-us,AX.60).gif Gg933800.static(en-us,AX.60).gif ::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

See Also

SysTestCase Class

Unit Test Framework

Walkthrough: Testing a Class Using the Unit Test Framework