Dar*_*key 4 c# unit-testing .net-core coverlet
有 .net core 3.1 Microsoft.net.sdk 项目,有大量异步 xUnit 测试。
dotnet test Common\Common.csproj /p:CollectCoverage=true /
显示 100%,但创建了一个空的覆盖文件dotnet test Common\Common.csproj --collect:"XPlat Code Coverage"
在 testresults\{guid}\coverage.cobertura.xml 中创建了一个文件 - 但它只是说lines-covered=0而 stdout 说 88 个测试在 4 秒内运行。我究竟做错了什么?
对我来说 coverlet.msbuild 与命令完美配合:
dotnet test Common\Common.csproj /p:CollectCoverage=true /p:IncludeTestAssembly=true /p:CoverletOutputFormat=cobertura /p:ExcludeByFile=\"**/Microsoft.NET.Test.Sdk.Program.cs\"
所以,我猜你在这里错过了 CoverletOutputFormat。
| 归档时间: |
|
| 查看次数: |
4076 次 |
| 最近记录: |