Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure unit test name/description on VSTS?

Tags:

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

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:

Test names in VSTS

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.

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

Resharper unit tests grouped by project structure

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

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

like image 873
Rui Jarimba Avatar asked Aug 16 '18 14:08

Rui Jarimba


1 Answers

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

like image 164
Daniel Mann Avatar answered Sep 28 '22 17:09

Daniel Mann