ReSharper:dotCover 未显示单元测试覆盖率

发布于 2025-01-10 09:20:59 字数 538 浏览 4 评论 0原文

在使用 ReSharper v.2021.3.3 的 Visual Studio 2019 v.16.11.10 中运行 ReSharper: dotCover 时,文件的覆盖范围不会显示/运行。

图像上显示了单元测试覆盖率的片段,其中可以看到单元测试的运行情况以及覆盖了多少测试。展开测试应该测试的包之一,可以看到ReSharper无法生成覆盖率。这是因为所有功能都打包到(1.0.0.0,.NETFramework,版本=v4.7.2)中吗?

如果这是问题,有什么解决方法吗?或者如果这条线引起任何问题,我该如何摆脱它?如果我去掉这条线,所有东西都会以不同的方式包装吗?或者一切都会像以前一样工作吗?

dotCover 单位测试覆盖率

我团队中的其他项目之一没有将所有内容打包到其中的额外行,并且 ReSharper 可以按其应有的方式生成单元测试覆盖率。

When running ReSharper: dotCover in Visual Studio 2019 v.16.11.10 with ReSharper v.2021.3.3, the coverage on the files is not shown/run.

On the image, a snippet of the Unit Test Coverage is shown, where it is seen that the unit tests are run and how much of those tests are covered. Unfolding one of the packages that should be tested by the tests, it is possible to see that ReSharper cannot generate coverage. Is this because all the functionality is packed into the (1.0.0.0, .NETFramework, Version=v4.7.2)?

If this is the problem, is there any workaround? Or how do I get rid of the line if it causes any problems? If I then get rid of the line, will everything then be packaged in a different manner? Or will everything work the same as before?

dotCover Unit Test Coverage

One of the other projects in my team does not have this extra line where everything is packed into, and ReSharper can generate Unit Test Coverage as it should.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦开始←不甜 2025-01-17 09:20:59

我通过清除 resharper 缓存、重新启动 Visual Studio 解决了该问题。下一次测试运行后,覆盖率计算正确。

要清除缓存,请转至 Extensions >重磨器>选项>环境>常规并按清除缓存按钮:

在此处输入图像描述

I fixed the problem by clearing the resharper-cache, restarting visual studio. After the next test-run, the coverage was calculated correctly.

To clear the cache, go to Extensions > Resharper > Options > Environment > General and press the Clear caches-Button:

enter image description here

卷耳 2025-01-17 09:20:59

在与 JetBrains 支持人员进行长时间的电子邮件通信后,问题似乎出在 dotCover 从 GAC 获取 DLL 文件上,导致 PBD 的 id 不匹配。

After a lengthy email correspondence with JetBrains's support, it seems like the problem is with dotCover grabbing the DLL files from the GAC instead, resulting in mismatched ids for the PBDs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文