0
votes

I have divided my source code and tests in separate solutions for C#. In my tests I create link to the actual code and implement stub-implementations for its dependencies where I can't mock the implementation.

If I run opencover or dotcover to get the coverage of the unit-tests and genreate a report with reportgenerator it groups the coverage per test assembly, however i want to map this coverage to the actual source code/assembly (from which i linked my file) in my resulting report.

Is there any way, in opencover or dotcover, to map my code coverage results with the actual code (and exclude my stub-classes that don't map with the code)?

1

1 Answers

0
votes

I fixed this by running a small script before generating the actual report. This script replaces the ModuleName in the XML of the coverage result by OpenCover with the assembly of my production code.

ReportGenerator will then nicely merge all my results into a single report.