Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NUnit Categories not showing up in Visual Studio

I want to custom group my tests by function so I'm using the nunit Category attribute, like this:

[Test, Category("Cat1")]
public void SomeMethod() { }

[Test, Category("Cat2")]
public void AnotherMethod() { }

But in Visual Studio the categories do not show up, all I see are the defaults to group by duration or test outcome. I'm using:

  • NUnit 2.6.4
  • Visual Studio 2012
  • NUnit Test Adapter 2.0.0.0

What am I missing? This seems like it should be a no-brainer

like image 885
snappymcsnap Avatar asked Mar 15 '23 17:03

snappymcsnap


1 Answers

You should be able to group your tests by Traits, which includes the Category attribute. If you can't then you may need to update your Visual Studio to at least Update 1. A more detailed description, targeted at the MS framework is here but the TestAdapter seems to allow it to work just fine with the NUnit Category attribute.

like image 81
forsvarir Avatar answered Mar 18 '23 07:03

forsvarir