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

标签 c# .net unit-testing azure-devops nunit

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

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

Test names in VSTS

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

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

Resharper unit tests grouped by project structure

我试过设置 TestNameTestFixture Attribute属性或设置 DescriptionTest 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)
    {
        // ...
    }
}

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

最佳答案

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

关于c# - 如何在 VSTS 上配置单元测试名称/描述?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51879444/

相关文章:

c# - 制作我们自己的 List<string, string, string>

c# - 如何为 Xamarin Forms ListView 创建消息框?

c# - SQL Server 到 Entity Framework 数据类型的映射

c# - Azure 存储资源管理器 : How to query Table Storage Rowkey with "Contains"?

Python/Django - 针对列表进行测试

python - 使用多个输入测试 Click 应用程序提示

c# - 添加安全 header 以帮助防止 c# asp.net 中的注入(inject)攻击

c# - 获取 knockout 模型中的 MVC Person 模型书籍列表(可观察数组)

c# - 64 位 Windows 服务器中的 Sybase 驱动程序错误

c# - 使用 Moq.It.IsAny 测试以某物开头的字符串