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

问题描述 投票:0回答:1

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

有没有办法配置测试名称在 Visual Studio Team Services (VSTS) 中的显示方式,也许显示测试类名称?目前它仅显示测试名称:

很难理解哪个测试属于哪个类别。在这种情况下,我至少有 2 个具有相同测试名称的测试类。

使用 Reshaper 的测试运行器运行相同的测试,很容易理解哪些测试属于哪些类:

我尝试过设置

TestFixture Attribute
属性的 TestName 或设置
Test Attribute
Description,但没有成功:

[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)
    {
        // ...
    }
}

那么如何在 VSTS 上配置测试的名称?

c# unit-testing azure-devops azure-pipelines nunit
1个回答
4
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.