【问题标题】:Disable running some xunit tests in Visual Studio (by Resharper)禁用在 Visual Studio 中运行一些 xunit 测试(由 Resharper 提供)
【发布时间】:2017-10-21 18:42:58
【问题描述】:

我有一些集成测试(运行时间很长)。如果它们在主要解决方案中并且我选择运行所有测试,这些测试也会被选中。 如何避免?

假设这些测试是从 CI 上的脚本运行的。特征没有帮助(AFAIK),因为 R# 也会选择它们。

【问题讨论】:

    标签: visual-studio unit-testing resharper xunit


    【解决方案1】:

    这个问题间接给出了答案:resharper test runner - how to execute by category?

    xUnit 中: 你添加一个特质:

    [Trait("Category", "LongRunning")]
    [Fact]
    public void Test()
    {
    }
    

    在“ReSharper->Options->Unit Testing”中,您需要排除类别“LongRunning”:

    PS,保存此更改时,您可能希望将其保存到“团队共享”层,以便您的团队拥有相同的方式。

    【讨论】:

      【解决方案2】:

      在 resharper 中使用不同的播放列表,或运行不同的特征(测试资源管理器)。 In Visual Studio Test, how to make a playlist which automatically excludes certain tests?

      【讨论】:

      • 我是绑定R#的,这个方案只能在VS Test中使用,不过我以后会试一试的。
      • 谢谢,虽然它没有给出解决方案,但您的回答让我知道我应该寻找(谷歌搜索)什么。
      猜你喜欢
      • 2018-01-12
      • 1970-01-01
      • 2023-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多