
Mastering Microsoft Dynamics NAV 2016
By :

If you have worked with C# code, then this part will be easy to relate to. All the functions have a prefix that defines the characteristic of the function. This is new in Microsoft Dynamics NAV, and personally, I think it is cool to have this in C/AL. The following screenshot shows a few examples of functions with prefixes:
In the essential part of the testability framework, we have the following four main parts:
Test codeunits
ASSERTERROR
UI handlers
Test runner/test isolation
The codeunits have a subtype. The subtype has a number of options such as Normal, Test, TestRunner, and Upgrade. If we select Test as a subtype of our codeunit, this means that we are able to create code here as a test code:
The code which inserts a value inside a table written in the Test codeunit does not actually enter the value into the table. The process is confined to only testing purposes. It virtually pushes the data and tests the success or failure condition.
When you create...