Resharper 单元测试运行器:MSTest 部署项目问题

发布于 2024-07-17 10:53:48 字数 354 浏览 5 评论 0原文

ReSharper 单元测试运行程序:支持部署项目

我有上述问题的后续问题。 我使用带有本机 mstest 支持的 resharper 版本 4.5 来运行 mstest 单元测试。 当我配置 resharper 的单元测试选项以使用我的 testrunco​​nfig(为了利用我的一组部署项目)时,我的测试运行结束,而不显示任何结果或错误。 有没有人使用 resharper 的 mstest runner 遇到相同的问题或类似的问题?

ReSharper Unit Test Runner: Support for Deployment Items

I have a follow up question for the question above. I'm using resharper version 4.5 with native mstest support to run mstest unit tests. When I configure resharper's unit test options to use my testrunconfig (in order to utilize my set of deployment items), my test runs end without displaying any results or errors. Has anyone using resharper's mstest runner had the same issue or anything similar?

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

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

发布评论

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

评论(4

九局 2024-07-24 10:53:48

事实证明,resharper 的 mstest 运行程序不适用于启用了代码覆盖率的 testrunco​​nfig 文件。 我通过在测试运行配置文件中禁用代码覆盖率解决了这个问题。

Turns out that resharper's mstest runner does not work on testrunconfig files that have code coverage enabled. I've worked around the problem by disabling code coverage in my test run config file.

没有心的人 2024-07-24 10:53:48

我也遇到了这个问题。 然而,我不想禁用代码覆盖率,因为我经常使用它。 构建服务器也使用它。 因此,我想要一个解决方案,让我可以在大多数时间使用 R# 的运行程序以方便使用,但仍然允许我使用 Visual Studio 的 MSTest 运行程序运行测试,以便在需要时获得代码覆盖率,并允许构建服务器继续运行生成代码覆盖率统计数据。

解决方法

我创建了一个名为 Resharper.testsettings 的附加测试设置文件。 它与我的正常 Local.testsettings 文件完全相同,只是它禁用了代码覆盖率。 然后我告诉 R# 使用这个特定的测试运行配置。

  1. 打开您的 Visual Studio 项目
  2. 选择测试 -> 编辑测试设置 -> 本地 (local.testsettings)(或您通常使用的任何测试设置)
  3. 单击“另存为...”将
  4. 文件命名为 ReSharper.testsettings
  5. 在“测试设置”窗口的常规选项卡的名称字段中,将名称更改为 ReSharper
  6. 单击数据和诊断< /strong>
  7. 取消选中代码覆盖率旁边的框
  8. 转到ReSharper->工具->单元测试
  9. 选择MSTest单元测试提供程序
  10. 选择“使用此测试运行配置:”
  11. 选择 ReSharper
  12. 单击确定

如果在步骤 8 中使用 R# 5.0,则会有额外的菜单深度:

  1. 转至Resharper->选项->工具->单元测试

I ran into this problem as well. I didn't want to disable code coverage however, because I often use it. The build server also uses it as well. So I wanted a solution that let me use R#'s runner most of the time for convenience, but still allow me to run my tests with Visual Studio's MSTest runner to get code coverage whenever I wanted as well as allow the build server to continue to generate code coverage statistics.

Workaround

I created an additional test settings file called Resharper.testsettings. It is exactly the same my normal Local.testsettings file except that it has code coverage disabled. Then I told R# to use this specific test run configuration.

  1. Open your Visual Studio Project
  2. Select Test->Edit Test Settings->Local (local.testsettings) (or whatever test settings you usually use)
  3. Click "Save As..."
  4. Name the file ReSharper.testsettings
  5. In the Name field of the General tab of the Test Settings window, change the name to ReSharper
  6. Click Data and Diagnostics
  7. Uncheck the box next to Code Coverage
  8. Go to ReSharper->Tools->Unit Testing
  9. Select the MSTest Unit testing provider
  10. Select "Use this Test Run Configuration:"
  11. Select ReSharper
  12. Click OK

If using R# 5.0 for step 8 there is an extra menu depth:

  1. Go to Resharper->Options->Tools->Unit Testing
著墨染雨君画夕 2024-07-24 10:53:48

您不需要 resharper 来支持独立的 mstest 安装。 我在我的帖子中解释了如何在没有 VS 的情况下进行独立的 mstest 安装 -
http://www.shunra。 com/shunrablog/index.php/2009/04/running-mstest-without-visual-studio

You do not need resharper to support standalone mstest installation. I explain how to make a standalone mstest installation without the VS in my post here -
http://www.shunra.com/shunrablog/index.php/2009/04/running-mstest-without-visual-studio

对你再特殊 2024-07-24 10:53:48

有类似的问题。 我的 MSTest 测试使用 Visual Studio 测试运行程序运行,但不是 R# 的运行程序。 引发的异常直接归因于 R# 测试运行找不到必须部署的文件(并在 testrunco​​nfig 中指定)。

尝试让它选择配置的文件并指定该文件。 没有骰子。

除了不指定任何内容(我不指定)之外,不知道如何在 testrunco​​nfig 文件中“禁用代码覆盖率”。

问过R#。 现在询问 StackOverflow 的观众。

Having similar problem. My MSTest tests run with Visual Studio test runner but not R#'s runner. The exception thrown is directly attributable to R# test run not finding the files that have to be deployed (and are specified in the testrunconfig).

Tried letting it pick the configured file and specified the file. No dice.

Don't know how to "disable code coverage" in the testrunconfig file other than to not specify any (and I don't).

Have asked R#. Now asking the StackOverflow audience.

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