Book Image

Microsoft Dynamics AX 2012 R3 Reporting Cookbook Update

Book Image

Microsoft Dynamics AX 2012 R3 Reporting Cookbook Update

Overview of this book

Table of Contents (17 chapters)
Microsoft Dynamics AX 2012 R3 Reporting Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a unit test class for an RDP class


Report data provider is the most important class while creating and designing an SSRS report in Dynamics AX R3. In an RDP class, all the business logic has been written in this class. In earlier chapters, we discussed the creation of SSRS reports using the RDP class. So in this recipe, we will use the existing RDP class VendInvoiceDP and we will write the unit test class for this RDP class.

Getting ready

To work with this recipe, we will create PKTVendInvoiceDPTest class which will extend the SysTestCase class.

How to do it...

  1. In an RDP class, all the business logic is written in the processReport() method. So we will write the unit test method for the processReport() method. First, create the PKTVendInvoiceDPTest class:

    class PKTVendInvoiceDPTest extends SysTestCase
    {
        RecId mainAccount_11005;
        RecId accountStructureId; 
        #define.inv1('inv1')
        #define.DimHier_BalSht('DimHier_BalSht')
        #define.p1('p1')
        #define.v1('v')
        #define...