The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.
SubType Property (Codeunit)
Sets the codeunit to method as a normal, test, test runner, or upgrade codeunit.
|Normal||A normal codeunit. This is the default setting.|
|Test||A test codeunit includes AL methods that test the application.|
|TestRunner||A test runner codeunit manages the execution of one or more test codeunits.|
|Upgrade||An upgrade codeunit includes AL methods for synchronizing changes to a table definition in an application with the business data table in SQL Server and migrating existing data.|
You can create test codeunits and test runner codeunits to test your application.
You write test methods as AL code in the test codeunits. When a test codeunit runs, it executes the OnRun method and then executes each test method in the codeunit, records the outcome in a log, and displays the results in a message window. The continuation of the test method run is dependent on successful run of the OnRun method. The difference between a normal codeunit and a test codeunit is their execution at run time. When a normal codeunit is run, if one of its methods fails, then the codeunit is terminated. When a test codeunit is run, if a method fails, then the method is terminated, but the codeunit continues to run the remaining methods.
A test runner codeunit runs the test codeunits that are programmed to run from its OnRun trigger. When a test runner codeunit runs, it does the following:
Calls the OnBeforeTestRun Trigger before each test codeunit, and the OnRun method and test method is executed.
Calls the OnAfterTestRun Trigger after each test code unit, and the OnRun method and test method is executed.
Indicates that a test method has failed if it invokes the user interface.