Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
.Automated Testing in Microsoft Dynamics 365 Business Central

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

Product type Book
Published in Apr 2019
Publisher Packt
ISBN-13 9781789804935
Pages 222 pages
Edition 1st Edition
Languages
Author (1):
Luc van Vugt Luc van Vugt
Profile icon Luc van Vugt

Table of Contents (17) Chapters

Preface Section 1: Automated Testing - A General Overview
Introduction to Automated Testing Section 2: Automated Testing in Microsoft Dynamics 365 Business Central
The Testability Framework The Test Tool and Standard Tests Section 3: Designing and Building Automated Tests for Microsoft Dynamics 365 Business Central
Test Design From Customer Wish to Test Automation - The Basics From Customer Wish to Test Automation - Next Level From Customer Wish to Test Automation - And Some More Section 4: Integrating Automated Tests in Your Daily Development Practice
How to Integrate Test Automation in Daily Development Practice Getting Business Central Standard Tests Working on Your Code Test-Driven Development Setting Up VS Code and Using the GitHub Project Other Books You May Enjoy

The Test Tool and Standard Tests

Ever since NAV 2009 SP1, providing automated tests has been a major part of Microsoft's work on the application. Using the testability framework, they have created the following:

  • A humongous set of automated tests to verify the standard application
  • A Test Tool feature, that has become part of the standard application
  • A vast number of test helper libraries

In this chapter, we will discuss all three matters in more details.

Note that each of these is provided by Microsoft as a separate component; that is, a .fob, on the product DVD and in the Docker images from NAV 2016 and up.

The Test Tool is also present in Business Central online, but you will only be able to fetch tests for the extensions that reside in CRONUS, not for the standard application. To get yourself a free trial, visit: https://dynamics.microsoft.com/en-us/business-central...

Test Tool

Goal: Understand what the Test Tool entails and learn how to use and apply it.

The Test Tool is a standard application feature that allows you to manage and run the automated tests that reside in the database, and collect their results, be they test codeunits that belong to the standard application or that are part of extensions. With the various hands-on example tests, we will be using this tool a lot. However, before we do this, let's elaborate a little bit on it.

You can easily access the Test Tool using the TELL ME WHAT YOU WANT TO DO feature in Dynamics 365 Business Central, as displayed in the following screenshot:

When in a clean database, or at least a database or company where the Test Tool has not been used yet, this is how the Test Tool appears. A suite called DEFAULT with no records in it appears, as seen as follows:

To populate the suite take the...

Standard tests

Goal: Get to know the basics of the standard tests provided by Microsoft.

Ever since NAV 2016, Microsoft made their own application test collateral a part of the product. A humongous set of tests is delivered as a .fob file on the product DVD, in the TestToolKit folder, and in the Docker images. Indeed, the tests haven't been delivered as an extension yet.

The standard test suite does contain mainly test codeunits. But there are also a number of supporting table, page, report, and XMLport objects in the .fob file.

For Dynamics 365 Business Central, the whole set contains almost 23,000 tests in more than 700 test codeunits, for w1 and local functionality for each country in which Microsoft releases. And with every bug that's fixed and with every new feature introduced in the application, the number of tests is growing. It has been built over the last...

Standard libraries

Goal: Get to know the basics about the standard test helper libraries provided by Microsoft.

Supporting their standard tests, Microsoft has created a nice and very useful collection of helper functions in more than 70 library codeunits. These helper functions range from random data generations and master data generation to standard generic and more specific check routines.

Need a new item? You might make use of the CreateItem or CreateItemWithoutVAT helper functions in Library - Inventory (codeunit 132201).

Need a random text? Use the RandText helper function in Library – Random (codeunit 130440).

Want to get the same formatted error messages when verifying your test outcome? Use one of the helper functions in the Assert (codeunit 130000), such as IsTrue, AreNotEqual, and ExpectedError.

A frequently reappearing question during my workshops is:

How do...

Summary

In this chapter, we discussed in a nutshell what the Test Tool is and how to use it to run your tests, or even run the collection of tests Microsoft has built and provided us with. We gave a short overview of the various categories of tests this vast collection contains. We concluded with a brief description of the 70+ libraries containing useful helper functions to support your own test writing.

Now that we have discussed the various test features that exist in Dynamics 365 Business Central, we are ready to go and start designing and coding our own test. We will start in Chapter 4, Test Design, to introduce several design patterns that facilitate easier and consistent test case coding.

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 2019 Publisher: Packt ISBN-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.
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}