- Automated Testing in Microsoft Dynamics 365 Business Central
- Luc van Vugt
- 89字
- 2021-06-24 14:56:49
Test codeunits
A test codeunit is defined by its Subtype:
codeunit Id MyFirstTestCodeunit
{
Subtype = Test;
}
This makes it different from a standard codeunit in a couple of ways:
- It can contain the so-called test and handler functions next to the normal functions we are used to when writing app code
- When executing a test codeunit, the platform will do the following:
- Run the OnRun trigger and each test function that resides in the test codeunit, from top to bottom
- Record the result of each test function