Unit Tests pass however zero coverage results

Answered

Platform

VS 2017 15.3

dotCover 2017.2

xunit 2.2

 

I have recently upgraded my projects to use netcore 2.0, in order to do this I had to update visual studio and reinstall the JetBrains tools. Unit test explorer is now showing my unit tests and showing them as successful, however the code coverage consistently shows zero percent code coverage. It lists all of the assemblies correctly. It was previously working, however since upgrading it now no longer works.

 

2 comments

Hi,

This problem could be connected with shadow-copying in xunit.runner.visualstudio.

As a current workaround, you could configure xUnit with JSON as described in this help topic: http://xunit.github.io/docs/configuring-with-json.html

Please add xunit.runner.json file to the root of your test project and specify the following setting:

{
"shadowCopy" : false
}


Then rebuild and rerun test under coverage.

-1

I tried following the steps however this has not worked either. 

0

Please sign in to leave a comment.