代码之家  ›  专栏  ›  技术社区  ›  Rui Jarimba

如何在VST上配置单元测试名称/描述?

  •  3
  • Rui Jarimba  · 技术社区  · 8 年前

    我有一个包含单元测试项目的解决方案。我正在使用nunitv3.10.1和nunit3testadapterv3.10.0。

    Test names in VSTS

    很难理解哪个测试属于哪个类。在本例中,我至少有两个测试类具有相同的测试名称。

    使用整形器的测试运行程序运行相同的测试很容易理解哪些测试属于哪些类:

    Resharper unit tests grouped by project structure

    TestName TestFixture Attribute Description Test Attribute 运气不好:

    [TestFixture(TestName = "MemoryCacheManagerTests_TryGetItem", TestOf = typeof(MemoryCacheManager))]
    public class MemoryCacheManagerTests_TryGetItem : MemoryCacheManagerTests
    {
        [Test(Description = "MemoryCacheManagerTests_TryGetItem_WithInvalidCacheKey_ShouldThrowArgumentException")]
        [TestCaseSource(typeof(InvalidCacheKeyTestCases))]
        public void WithInvalidCacheKey_ShouldThrowArgumentException(string key)
        {
            // ...
        }
    }
    

    那么如何配置vst上的测试名称呢?

    1 回复  |  直到 8 年前
        1
  •  4
  •   Daniel Mann    8 年前

    不,没有办法配置它。您可以提交一个UserVoice项目来建议产品改进。