Tested project assembly excluded from coverage tree

Completed

We have a large solution with 70+ projects. I have an MVC controller class in one of these projects which I have created a unit test for one its methods.

When I select this test in the Unit Test Explorer window, then select "Cover Unit Tests", in the Unit Test Sessions window it shows the test has passed, but in the coverage analysis to the right, the assembly containing this class does not appear in the coverage tree.

If I select a different unit test that covers a method in a different project and do the same thing, that project assembly is excluded from the coverage tree.

If I select unit tests covering code from two different projects and select "Cover Unit Tests", both project assemblies are excluded from the coverage tree.

A different issue that may or may not be related - when I right click on a line of code in the controller method that this unit test is testing, and I select the "Show Covering Tests" option, it tells me "no unit tests cover this statement."

I've double checked my filters, there's just a line in there that says "Exclude by attribute" with one item to the right of it with a checkbox that is checked that is labeled "Systems.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute"

3 comments

I am having a similar issue. When I run the code coverage, VS generates code coverage statistics, but I cannot see the tests in the snapshot viewer, and that means I also cont see the highlighting of the code that is or isn't covered. Hopefully someone will be by top provide some assistance.

0

Jetbrains got back to me:

It looks like a known issue: https://youtrack.jetbrains.com/issue/DCVR-7976, the current workaround is to switch off "Shadow-copy assemblies being tested" option in "ReSharper >> Options >> Tools >> Unit Testing"

 

This workaround solved the problem for me.

0

Thanks for getting back to me, Doug. I appreciate that. 

0

Please sign in to leave a comment.