How to run unit tests by category in Rider?

1.5k Views Asked by At

I want to run NUnit Tests from Rider's Unit Tests Explorer filtered by Category. Rider 2017.1. Is it possible? When it will be possible, if planned to implement?

2

There are 2 best solutions below

0
On BEST ANSWER

This feature is not supported in Rider 2017.1, here is the issue: https://youtrack.jetbrains.com/issue/RIDER-2316

Update: The category support was introduced in Rider 2019.1. You can find more information in this blog post.

0
On

Rider 2019.1.1 supports it.

For class:

enter image description here

[TestFixture, Category("Regression_Test")]
class className
{
    [Test]
    public void functionOne()
    {
       ...
    }
}

For function:

enter image description here

class className
{
    [Test, Category("Regression_Test")]
    public void FunctionOne()
    {
       ...
    }
}