Unit testing TRDX Report generation with Object datasource

2 posts, 0 answers
  1. Piyush Bhatt
    Piyush Bhatt avatar
    20 posts
    Member since:
    Oct 2014

    Posted 02 Aug 2016 Link to this post

    We have a TRDX report with Object data source - that has Object = "XYZReport" and DataMember = "GetData()"

    When the report is opened via viewer - everything runs fine.

    When the report is rendered in a unit test method in a unit test project, it does not invoke GetData() method at all and renders empty report. The XYZReport class is in a separate Project/Classlibrary and Unit Test project references it. 

    Any clue what could be happening and how we can resolve this?

  2. Nasko
    Nasko avatar
    1094 posts

    Posted 04 Aug 2016 Link to this post

    Hello Piyush Bhatt,

    Perhaps the report viewer project references the correct assemblies which allow the report to retrieve its data. The unit test project, on the other hand, might not reference the required assemblies and the data cannot be retrieved there.

    Since you do not need to create any unit tests for Telerik Reporting modules, you can only retrieve the data and check that it is correct in your unit test project i.e., test only the GetData() method. Testing that Telerik Reporting produces correct report output based on given input data is done on our end.

    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top