Reader small image

You're reading from  .Automated Testing in Microsoft Dynamics 365 Business Central

Product typeBook
Published inApr 2019
Reading LevelIntermediate
PublisherPackt
ISBN-139781789804935
Edition1st Edition
Languages
Right arrow
Author (1)
Luc van Vugt
Luc van Vugt
author image
Luc van Vugt

In 1999, Luc van Vugt stepped into the Dynamics 365 Business Central (BC) world, training many developers. After Microsoft acquired Navision, he joined their Dynamics localization team as tester and project lead, 6 years closely involved with all BC releases. Since he left MS, he became an active community member with his blog, Dutch Dynamics Community and as conference speaker. He co-founded NAV Skills, supporting BC pros with workshops and webinars until 2019. He continues ever since with webinars under the flag of Areopa. For all this work, Luc has been awarded MS MVP since 2011. In 2012, he started fluxxus.nl mainly focusing on BC development courses and workshops on test automation, on the latter a main driving force in the community.
Read more about Luc van Vugt

Right arrow

The Testability Framework

With Dynamics NAV 2009 Service Pack 1, Microsoft introduced the testability framework in the platform. This enabled developers to build test scripts in C/AL to run so-called headless tests; that is, tests that do not use the user interface (UI) to execute business logic. It was a follow-up on an internal tool called the NAV Test Framework (NTF) and had been used and worked on for a couple of years already. It allowed tests to be programmed in C# and ran against the Dynamics NAV UI. It was a neat system, with a neat technical concept behind it. However, this running test against the UI was one of the major reasons for leaving NTF behind. I seem to recall that it was the major reason because accessing business logic through the UI is slow – too slow. Too slow to allow the Microsoft Dynamics NAV development team to run all their tests against the...

The five pillars of the testability framework

In the following five sections, each pillar will be discussed and illustrated with a simple code example. Feel free to try them out yourself. But, of course, being a hands-on book, we will get to a lot of more relevant examples later on.

The code examples can be found on GitHub at https://github.com/PacktPublishing/Automated-Testing-in-Microsoft-Dynamics-365-Business-Central.

Details on how to use this repository and how to set up VS Code are discussed in Appendix B, Setting Up VS Code and Using the GitHub Project.

Pillar 1 – Test codeunits and test functions

Goal: Understand what test codeunits and test functions are and learn how to build and apply them.

The foremost...

Summary

In this chapter, we discussed what the testability framework is by describing the five pillars it entails: the basic elements test codeunits and test functions, the new code keyword asserterror, handler functions to allow automatic handling of UI elements, the test runner to enable us to run tests in isolation, and, finally, test pages to build tests to check the behavior of pages.

In Chapter 3, The Test Tool and Standard Tests, you will learn about the test tool that resides in Business Central and the set of standard tests being released by Microsoft with the product.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
.Automated Testing in Microsoft Dynamics 365 Business Central
Published in: Apr 2019Publisher: PacktISBN-13: 9781789804935
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Luc van Vugt

In 1999, Luc van Vugt stepped into the Dynamics 365 Business Central (BC) world, training many developers. After Microsoft acquired Navision, he joined their Dynamics localization team as tester and project lead, 6 years closely involved with all BC releases. Since he left MS, he became an active community member with his blog, Dutch Dynamics Community and as conference speaker. He co-founded NAV Skills, supporting BC pros with workshops and webinars until 2019. He continues ever since with webinars under the flag of Areopa. For all this work, Luc has been awarded MS MVP since 2011. In 2012, he started fluxxus.nl mainly focusing on BC development courses and workshops on test automation, on the latter a main driving force in the community.
Read more about Luc van Vugt