I am running the latest version of TC (9.0.4), the correct (newer) VSTest console runner plugin, the logger, and bundled dotCover on a set of C# solutions with tests.
Everything ran perfectly with dotCover getting the coverage for me on basic unit tests. When I added a test project with MS Fakes, I got this:
" No covered code was detected.
The issue could be caused by one of the following:
- Include / exclude patterns are incorrect
- Assemblies are compiled without debugging information
- .pdb files are not available
- Visual Studio code coverage is enabled for MSTest
- .testrunconfig is used for MSTest and Visual Studio code coverage is not disabled (CodeCoverage section with enable="true" is present) "
All settings the same... and there is no .runsettings file in my project. Is it considering some of the Fakes tools as diagnostic data adapters? Or is it a specific setting in the test project? I looked and didn't see anything in the test .csproj that looked like it would trigger this type of message.
I made a command line build step to run VSTest and dotCover on the tests with the same result.
I need coverage on my MS Fakes tests... What am I missing? Any help or ideas would be appreciated. :)
EDIT: Just found this in the issue tracker: DCVR-2341 Ability to cover tests which use Fakes/Moles mocking framework
They put this on hold four years ago and nobody is assigned to this issue. Fakes is commonly used now. I guess I'll have to switch to something else like a lot of the other commenters on that page. :(
ANOTHER EDIT: This open source project just added full support for Fakes a couple of months ago: https://github.com/OpenCover/opencover
Hopefully the DotCover team can figure it out from that.... ;)