Visual studio code coverage from many different un

2020-07-29 23:07发布

问题:

I'm using visual studio 2015 Enterprise.

Let's say I have my main ProjectA, and two unit test projects UnitTestsA, UnitTestsB, each containing some test methods.

UnitTestsA covers 5 blocks out of 10 of my code, UnitTestsB covers 2 different blocks out of 10. When I ask visual studio to analyze code coverage, I would expect it to return 7 out of 10 blocks covered. Instead, it returns 7 out of 20 blocks covered.

Seems like it doesn't realize the 2 projects are testing the same code. Am I doing something wrong, or is it the expected behavior?