Development Tips

Adding a Test to a Test Runner Codeunit

How to add a line to test runner codeunit that runs the new TestVendorDiscount codeunit.

The test runner codeunit runs all the test codeunits that you may have created to test the other customized functionality.

To add a test to a test runner codeunit

  • In the development environment, on the Tools menu, choose Object Designer.
  • In Object Designer, choose Codeunit, select the existing test runner codeunit, and then choose the Design button.
  • In the C/AL Editor, in the OnRun function, add the following code.


  • On the File menu, choose Save.

For more details see below posts:

Creating a Test Codeunit and Test Function
Creating a Test Runner Codeunit


3 thoughts on “Adding a Test to a Test Runner Codeunit”

Comments are closed.