How to get NUnit build step to accept Category Expressions


We have tests that are organized by categories.  In order to run specific tests, we make use of the Category Expressions that are available since 2.4.6 (see below).  From in the 'Specifying Test Categories to Include or Exclude' section:

Beginning with NUnit 2.4.6, you may use a Category Expression with either of these options:

Selects tests having any of the categories A, B or C.
Selects tests having any of the categories A, B or C.
Selects only tests having all three of the categories assigned
Selects tests with both A and B OR with category C.
Selects tests with both A and B but not C.
Selects tests not having category A assigned
Selects tests having both category A and either of B or C

For example in your test assembly, there are a group of tests marked with one category (say 'RRR').  Each of those are categorized under other categories (i.e. 'A1', 'A2', 'A3', etc).  To run the tests that are in the intersection RRR and A1 you would use RRR+A1.  However, if you use the NUnit step and include the RRR+A1 no tests are run.  You can get tests to run by using RRR or A1 as the category, but not the RRR+A1.

Please let me know if you know of a way to use the expression in the build step.

Comment actions Permalink


Sorry for delay. Please feel free to post the issue for that at
I believe the most easiest way for you to run the tests is to use TeamCity addin for NUnit,
please take a look to the related documentation on it at


Comment actions Permalink

Thanks.  Issue created.


Please sign in to leave a comment.