Skip to main content

Command Palette

Search for a command to run...

Installing the Test Toolkit

Automated Tests in Dynamics 365 Business Central

Updated
2 min read
Installing the Test Toolkit

There are several options for installing the Test Toolkit in a Microsoft Dynamics 365 Business Central container. Which option is available to you depends on whether you are creating a new container or you already have one up and running.

Include Test Toolkit on container creation

The Test Toolkit can be included upon creation of your container through the BcContainerHelper PowerShell Module.

There are three switches that you can set in order to control which parts of the Test Toolkit will be installed:

  • -includeTestToolkit is the main switch and is required to enable the installation of the Test Toolkit. If specified alone it will cause a full install of the Test Toolkit which also includes Microsofts test suites.

  • -includeTestFrameworkOnly will only install the Test Framework. The Test Framework contains the required dependencies for developing automated tests.

  • -includeTestLibrariesOnly will install the Test Framework including a wide selection of libraries created by Microsoft.

Here is an example of how to create a container with the Test Toolkit included:

$username = "admin"
$password = ConvertTo-SecureString "#LetMeIn123" -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential($username, $password)
$artifactUrl = Get-BCArtifactUrl
New-BcContainer "AUTOMATEDTESTS" -artifactUrl $artifactUrl -Credential $credential -updateHosts -accept_eula -includeTestToolkit -includeTestFrameworkOnly

Install the Test Toolkit on an existing container

When you already have a container running but want to start using the Test Toolkit you can install it with the BcContainerHelper PowerShell Module.

Running the command Import-TestToolkitToBcContainer command will install the Test Toolkit in the specified container.

It is also possible to specify the -includeTestFrameworkOnly and -includeTestLibrariesOnly switches as mentioned above.

Here is an example of how to install the Test Toolkit in an existing container:

Import-TestToolkitToBcContainer "AUTOMATEDTESTS" -includeTestLibrariesOnly

Automated Tests

Part 2 of 2

This series describes how to get started with automated tests in Dynamics 365 Business Central. You will also find advice on how to solve challenges when writing automated tests and testable code.

Start from the beginning

How to test for errors

Automated Tests in Dynamics 365 Business Central

More from this blog

Kasper Mørch's Blog about Microsoft Dynamics 365 Business Central

4 posts

This blog is about development and automated testing for Dynamics 365 Business Central using Microsoft AL and Visual Studio Code. You may also find a few posts about Dynamics NAV, C/Side and C/AL.