I have a project A
for which I wrote unit tests in test project UnitTests
. I use MSTest.
I wrote some testing utils in the file UnitTestUtils.cs
which simplify testing project A
. I also covered these utils with unit tests.
The file structure now is
- A
- Program.cs
- UnitTests
- Utils
- UnitTestUtils.cs
- Tests.cs <- (A_SomeTest1, A_SomeTest2, ...)
- UtilsTests.cs <- (Utils_SomeTest1, ...)
- Utils
All tests for A
are prefixed by A_
and all tests for utils are prefixed by Utils_
.
I want to run code coverage for test utils using coverlet.collector
like in this instruction.
I can specify a prefix for tests which I want to run by using dotnet test --filter Utils
, but code coverage gives me not coverage of my testing utils, but for the project A
.
How can I run code coverage for my testing utils?