I am trying to generate Code coverage report in 2 ways.
- Using
Fine Code Coverage
. There i see all 3 projects of me covered & its % of coverage. - Using Azure devops Pipeline where i use
DotNetCoreCLI@2
&PublishCodeCoverageResults@1
to build & generate the report. But the issue is API project is not considered in the report. both in trx & xml file.
So i tried MSBuild commands to repro the issue. To run the test cases & to build the xml file i am using below command.
dotnet test --collect:"XPlat Code Coverage"
After that to publish the coverage using below command.
dotnet test /p:CollectCoverage=true
Issue:- In above command also , i don't see my Api Project is getting into report, where as i see the API layer unit test are running.
Below is my project structure( using clean code architecture/Onion architecture)
Why only API is getting excluded , where as all unit test are running for the same.