Question
You develop a test application.
You must meet the following requirements:
Roll back changes to a test method after run time.
Run an approve action on a test page named TestPageA.
You need to implement the given requirements on the test codeunit.
Which actions should you perform? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Explanation
For rolling back changes to a test method, set the TransactionModel attribute to AutoRollBack: the test method starts a transaction, and when it completes, the transaction is rolled back and the database returns to its initial state. The TestIsolation property is the tempting wrong choice, but it belongs on a test runner codeunit rather than the test codeunit in question, while CommitBehavior and ErrorBehavior do not roll a test method back. For running an approve action on TestPageA, call TestPageA.Approve.Invoke(), because page actions on a test page are reached with dot notation and run with the Invoke method. Enabled and Visible only report the state of the action without running it, and Trap catches a call that opens a test page.