I am using Coverlet
on an open source project (Lewee) and getting 0% coverage for integration tests run using
Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory<T>
.
I've created this repository as a more minimal replication of the issue.
My hypothesis is that problem may occur when you use an implementation of Xunit.ICollectionFixture<T>
to "reset" a database before each test.
Running this experiment requires PowerShell.
dotnet tool install -g dotnet-reportgenerator-globaltool
.\test-coverage.ps1
.\coverage-report\index.html