Is there way to get Code coverage for classes which doesn't contain any unit test using OpenCover

43 views Asked by At

I am trying to see how much code in my source project(.net) is covered by the unit test in my test project using OpenCover.exe.

'Path to OpenCover.exe' - target:'dotnet.exe' -targetargs:'test project path' -output:'.\coverage.xml' -nodefaultfilters -filter:'-[NUnit*]* -[*.Tests]* -[Moq*]*' -register:user -oldstyle"

Above is the line I have been using to generate the xml report and here I have filtered out Nunit and Test project file it self to get more accurate reading.

My problem is if a person add new class file and add new code into it , if he doesn't care to write any unit test to it. OpenCover will not recognized the newly added class. any suggested solution to this ? any tips on how I can achieve what I am hoping for

what I was hoping to achieve is to take all the code in my source project as 100% and see how many of it is covered, example 50% is covered and 50% is not covered.

0

There are 0 answers