Michel
Michel

Reputation: 23615

Add all Visual Studio unit tests with a specific TestCategory to a new Resharper testsession

In Visual Studio, in the Test Explorer window, when I group the tests on 'traits', the tests are grouped on a specific category (the public sealed class TestCategoryAttribute class I've put on the unit test)

Is there a way to do the same thing in the Resharper 'unit test sessions' window?

I would like to create a new session with all the tests which have a specific category.

Upvotes: 1

Views: 150

Answers (2)

bodhizero
bodhizero

Reputation: 589

It is possible but is a multi-step process:

  1. Create a session that includes all of your tests (or at least all tests in the target category)

  2. In that session, go to Options -> Group by -> Categories

  3. Right-click the category in the results pane and select "Create New Session"

Upvotes: 1

Bob Lokerse
Bob Lokerse

Reputation: 453

You could add the annotation Category() to the test method.

[Test]
[Category("MyCategory")]
public void MyTestMethod_Example()
{
    // ...
}

Upvotes: 0

Related Questions