This is a migrated thread and some comments may be shown as answers.

Unit testing TRDX Report generation with Object datasource

1 Answer 101 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Piyush Bhatt
Top achievements
Rank 1
Piyush Bhatt asked on 02 Aug 2016, 10:39 PM

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?

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 04 Aug 2016, 03:45 PM
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.

Regards,
Nasko
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
Tags
General Discussions
Asked by
Piyush Bhatt
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or