Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do multiple categories lead to multiple tests, for nunit test fixtures?

say that i have the following setup:

[TestFixture, Category("aCategory"), Category("anotherCategory")]
public class SomeClass{
   [Test]
   public void SomeTest()
   {
      //testing
   }
}

how many times will the SomeTest be run? once, with the results shown in both categories, or twice, once for each category?

like image 620
blueberryfields Avatar asked Oct 22 '25 06:10

blueberryfields


1 Answers

In NUnit, categories act more like filters than a grouping mechanism.

When selecting the tests to run, you can include or exclude multiple categories, which will affect which tests are selected for a given run of the test suite.

You can assign multiple categories to a test class or method, but for a given run of the suite, each method will only be executed once.

like image 169
Trey Mack Avatar answered Oct 23 '25 21:10

Trey Mack



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!