我有一个包含单元测试项目的解决方案。我正在使用 NUnit v3.10.1 和 NUnit3TestAdapter v3.10.0。
有没有办法配置测试名称在 Visual Studio Team Services (VSTS) 中的显示方式,也许显示测试类名称?目前它只显示测试名称:
很难理解哪个测试属于哪个类。在这种情况下,我至少有 2 个具有相同测试名称的测试类。
使用 Reshaper 的测试运行器运行相同的测试,很容易理解哪些测试属于哪些类:
我试过设置 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)
{
// ...
}
}
那么如何在 VSTS 上配置测试的名称呢?
最佳答案
不,没有办法配置它。您可以提交 UserVoice 项目以提出产品改进建议。
关于c# - 如何在 VSTS 上配置单元测试名称/描述?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51879444/