5

我在使用 opencover 从我的课程中获得覆盖时遇到问题。

我有一个带有主要类的 Viewer.dll 和一个带有查看器测试的 Viewer_Test.dll。

执行命令后,所有测试都按预期运行。

OpenCover.Console.exe -register:user -target:"$(nunitpath)/nunit-console-x86.exe" -targetargs:"/noshadow Viewer_Tests.dll /domain:single" -filter:+[*]* -output:coverage.xml

ReportGenerator.exe coverage.xml "coveragereport" html

如果我查看生成的报告,我只会发现列出的测试类,而不是主要类。

这是 opencover 命令的控制台输出。

Committing...
Visited Classes 5 of 5 (100)
Visited Methods 41 of 41 (100)
Visited Points 482 of 557 (86.5350089766607)
Visited Branches 6 of 12 (50)

==== Alternative Results (includes all methods including those without corresponding source) ====
Alternative Visited Classes 5 of 5 (100)
Alternative Visited Methods 44 of 44 (100)

我怎样才能让 opencover 也覆盖 Viewer.dll?

4

0 回答 0