TestIsolation Property
Version: Available or changed with runtime version 1.0.
Specifies which changes to the database to roll back after the tests in the test runner codeunit execute.
Applies to
- Codeunit
Property value
Value | Available or changed with | Description |
---|---|---|
Disabled | runtime version 1.0 | Do not roll back any changes to the database. Tests are not isolated from each other. This is the default value. |
Codeunit | runtime version 1.0 | Roll back all changes to the database after each test codeunit executes. |
Function | runtime version 1.0 | Roll back all changes to the database after each test method executes. |
Syntax
TestIsolation = Codeunit;
Remarks
We recommend that you design tests to be independent of each other. Tests might read from and write to the same database, which means that tests can interact with each other. If tests interact, then you may experience incorrect test results. To eliminate test interactions, use the TestIsolation property to roll back changes to the database after each test method or after each test codeunit.
Note
If you specify that you want to roll back database changes, then all database changes are rolled back, including changes that were explicitly committed to the database during the test by using the Commit Method.