After playing around with the application test library (ATL) for Microsoft Dynamics 365 for Finance and Operation for some time I want to share some first impressions with you.
For your background: We are heavily using the SysTest-Approach to write unit tests for nearly all our extensions, which leads to almost 1.500 unit tests in one of our implementation projects. To make the development of unit tests easier and more streamlined, we developed our own unit test library over the last year, to do almost everything you can to in Dyn365FO, headless from (unit test) code.
With version 10.0.2 PU26 we get the application test library (ATL) from Microsoft with the same purpose as described above… you can do almost everything in Dyn365FO, headless from code with this library. A good starting point to get used to the new library are the following links:
To be honest without “real” examples it is very hard to create your fist test. The examples are coming in the next release (10.0.3 PU27), but I got some hints from Ivan Kashperuk on how to create my first tests. You can find my first test in the following Repository on GitHub. When I find some time I will add some more to this repository. The main goal of the two tests is to demonstrate a complete sales order process with a WHS1 and WHS3 item.
To get you I feeling on how and when to use ATL here are some thoughts:
- Implement test driven development by developing a failing test first.
- Prepare data for testing via the client in case data preparation takes much time.
- If you haven’t done this during test driven development, you can write unit/integration/process tests for your implementation.
- To commit changes in the community driven development (CDE) program, ATL tests are mandatory.
- Execution of ATL tests via “Test Explorer” in Visual Studio is possible without an internet connection, so you can use it almost everywhere.
To wrap up this post I think it will take months or even years to catch up with this powerful tool that has been developed by Microsoft over the past years. I´m quite sure that even after months of usage you will find new features and functions in it.
And one final thing: The execution of an ATL test in an empty dataset is super-fast, despite the fact that the complete setup has to be created first during the execution.