How to do it...

  1. Create a new folder in Windows Explorer to hold your test application. Make sure that this folder is not within the same project folder that contains your Television Shows project files.

Copy the following folders and files into the new folder from your Television Shows project folder:

  1. In Visual Studio Code, open the new folder. In Explorer, select app.json and update the "id" property to a new GUID.
You can use the new-guid command in the Terminal window to generate a new GUID.
  1. In app.json, update the value of the "name" property, as follows:
"name": "Television Show Test"
  1. Since we're testing our Television Shows application, we need to add a dependency to it because our tests need to interact directly with the entities in that application.

In app.json, modify the "dependencies" property to add a dependency as follows:

"dependencies": [
{
"appId": "",
"name": "",
"publisher": "",
"version": ""
}
]
You need to open the app.json file in your Television Shows project and get the four values needed for the previous property. 

Here is an example of what you should have once you fill in all of the values:

"dependencies": [
{
"appId": "0e8ea749-edf6-4a29-a396-018ae7aca20a",
"name": "ALProject1",
"publisher": "Default publisher",
"version": "1.0.0.0"
}
]
  1. In app.json, update the value of the idRange property:
"idRange": {
"from": 50150,
"to": 50199
}
  1. In order to use the default test libraries that Microsoft supplies, we need to add the following property to app.json:
"test": "13.0.0.0"
  1. In Explorer, create a new file named My Test.al and create a new codeunit object:
codeunit 50150 "My Test"
{

}
  1. Press Ctrl + Shift + P and type in or select AL: Download symbols.
  2. Once your symbols have been downloaded, the contents of the .alpackages folder should look similar to this:

Note that the names and versions of the files will vary.

That's it! We now have a Business Central test application that we can use to perform tests on our Television Shows application.