DotCover shows only unit test source code not production code
Asked Answered
M

2

4

I'm starting to use dotCover. I have a set of Debug compiled dlls + their pdbs. Then I've created a test project and executed resharper on it to see the coverage. What I'm getting is the coverage only of the unit test project instead of the whole coverage:

enter image description here

I expected to find on the coverage tab the dlls referenced from my unit tests and their coverage. Am i right? Maybe I'm missing something or am I doing something wrong?

Maffick answered 22/4, 2013 at 10:15 Comment(6)
Are all the pdbs in the same folder with the test assemblies and the target assemblies (1 pdb per dll)?Argumentation
Yes they are. What is weird is that if I manually open a source file of the product that has been exercised by the tests I see the lines highlighted ... so NCover knows that they have been covered, looks like the problem is only in the reports ...Maffick
Do you have a separate solution with the tests? You can also try to uncheck the "Match coverage results with current project structure" button.Bramlett
@DariaDovzhikova: yes I do, does that make a difference?Maffick
@SoMoS, it does if you select "Match coverage results with current project structure" option. In this case dotCover shows coverage results for tests from your current solution.Bramlett
@DariaDovzhikova: please add your comment as an answer and I'll accept it. It worked!Maffick
B
5

You can try to uncheck the "Match coverage results with current project structure" button, otherwise dotCover shows coverage results for tests only from your current solution.

enter image description here

Bramlett answered 14/5, 2013 at 15:6 Comment(1)
With dotCover 2018.2.3, I had to change another setting in order for assemblies located in a different solution to be shown in my Unit Test Coverage window. In the ReSharper menu, click Options.... Under dotCover, click on Filtering. Next, for Predefined coverage filter, select the radio button labeled Cover all excluding System and dotCover assemblies.Fulsome
E
0

Did you check your project settings to makes sure you are creating and exporting PDBs?

I had the same problem, because I was set to release, and in my release settings I did not export PDBs. Once I moved back to debug mode, the dotCover showed the assemblies that I wanted.

Ellerd answered 2/11, 2020 at 18:0 Comment(1)
Yes, as indicated in the question PDBs were there. The previous answer hit the issue, the tests run were not loaded into VsMaffick

© 2022 - 2024 — McMap. All rights reserved.