O'Reilly logo

Microsoft Dynamics AX 2012 R3 Reporting Cookbook by Deepak Agarwal, Chhavi Aggarwal, Kamalakannan Elangovan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a unit test class for a controller class

In the previous recipe, you learned how to write a unit test class for a contract class. In this recipe, you will learn how to create unit test classes for a controller class. A controller class is used for report execution as well as processing of report data. For the unit test class, first we will create a new controller class and then test the business logic inside that controller class in AX R3.

Getting ready

To work with this recipe, we need to create a controller class named PKTVendInvoiceController that extends SRSReportRunController.

How to do it...

  1. The first step is to add a PKTVendInvoiceController class which extends SRSReportRunController:
    public class PKTVendInvoiceController extends SrsReportRunController ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required