Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Reference for VSTest and MTP test filter syntax across frameworks, plus VSTest-to-MTP filter translation.
50% 100%+50 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 11 of 22 without it.
When running NUnit tests via standard `dotnet test`, what is the command-line flag to exclude any test with `TestCategory` set to `Slow`?
The command passes --filter "TestCategory!=Slow"
3 of 3 safety checks passed
Filter syntax depends on the platform and test framework.
dotnet test --filter <EXPRESSION>
Expression syntax: <Property><Operator><Value>[|&<Expression>]
Operators:
| Operator | Meaning |
|---|---|
= | Exact match |
!= | Not exact match |
~ | Contains |
!~ | Does not contain |
Combinators: | (OR), & (AND). Parentheses for grouping: (A|B)&C
Supported properties by framework:
| Framework | Properties |
|---|---|
| MSTest | FullyQualifiedName, Name, ClassName, Priority, TestCategory |
| xUnit | FullyQualifiedName, DisplayName, Traits |
| NUnit | FullyQualifiedName, Name, Priority, TestCategory |
An expression without an operator is treated as FullyQualifiedName~<value>.
Examples (VSTest):
# Run tests whose name contains "LoginTest"
dotnet test --filter "Name~LoginTest"
# Run a specific test class
Next to this one in the catalogue, plus more from the same author.