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...
- The first step is to add a
PKTVendInvoiceController
class which extendsSRSReportRunController
:public class PKTVendInvoiceController extends SrsReportRunController { } public void execute(Args _args) { this.parmReportName(ssrsReportStr(PKTVendInvoice, Report)); this.parmArgs(_args); this.startOperation(); } public static PKTVendInvoiceController construct() { return new PKTVendInvoiceController...