如何在 VSTS 上配置单元测试名称/描述? [英] How to configure unit test name/description on VSTS?

查看:28
本文介绍了如何在 VSTS 上配置单元测试名称/描述?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a solution that contains a unit test project. I'm using NUnit v3.10.1 and NUnit3TestAdapter v3.10.0.

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

Is there a way to configure how the test names are displayed in Visual Studio Team Services (VSTS), maybe displaying the test class name? At the moment it displays only the test name:

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

It's hard to understand which test belongs to which class. In this case, I have at least 2 test classes that have the same test names.

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

Running the same tests using Reshaper's test runner it's quite easy to understand which tests belong to which classes:

我已经尝试设置 TestFixture 属性的 TestName 属性或设置测试属性的Description 运气不好:

I have tried settings the TestName of the TestFixture Attribute attribute or setting the Description of the Test Attribute with no luck:

[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 上配置测试的名称?

So how do I configure the names of the tests on VSTS?

推荐答案

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

No, there's no way to configure it. You can submit a UserVoice item to suggest product improvements.

这篇关于如何在 VSTS 上配置单元测试名称/描述?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆