SysTestCase.parmExceptionExpected Method [AX 2012]
Determines whether an exception is expected in the current test.
The following example demonstrates how the SysTestCase.parmExceptionExpected method could be used to test the fictitious Employee class.
void testRetire()
{
// Create an instance of the employee.
Employee employee = new Employee();
// Call the retire method, first time should be successful.
employee.retire();
// Assert that an exception is expected.
this.parmExceptionExpected(true, "Already retired");
// Call the retire method. An exception is expected.
employee.retire();
}
Community Additions
ADD
Show: