Search code examples
c#visual-studionunit

How to get traits in Visual Studio using NUnit


In Visual Studio there is a Test Explorer where there is a column "Traits".

In the code I have used NUnit property attribute like this:

[Test]
[Property("foo", "bar")]

And that then went into the "Traits" column. But now after updating VS it is gone.

Is this a known issue, or is there a more correct way to get something to display in the "Traits" column of the Visual Studio Test Explorer window.


Solution

  • Yes, it is a known issue. The problem happens in Version 17.11. You can vote on the report and leave comments to get Microsoft's attention.

    Error report: https://developercommunity.visualstudio.com/t/Test-Explorer-not-showing-trait-values/10731811?q=test+explorer++traits