---
This skill inherits all available tools. When active, it can use any tool Claude has access to.
references/blame-mode.mdreferences/parallel-execution.mdRun .NET tests selectively using a build-first, test-targeted workflow optimized for development speed.
Follow this workflow to run tests efficiently:
Build the entire solution with minimal output to catch compile errors early:
dotnet build -p:WarningLevel=0 /clp:ErrorsOnly --verbosity quiet
Run tests for the specific test project with --no-build to skip redundant compilation:
dotnet test path/to/project --no-build --verbosity quiet
Narrow down to specific tests using filter expressions:
# By method name (contains)
dotnet test --no-build --filter "Name~MyTestMethod"
# By class name (exact match)
dotnet test --no-build --filter "ClassName=MyNamespace.MyTestClass"
# Combined filters
dotnet test --no-build --filter "Name~Create|Name~Update"
| Command | Purpose |
|---|---|
dotnet build -p:WarningLevel=0 /clp:ErrorsOnly --verbosity quiet | Build solution with minimal output |
dotnet test path/to/Tests.csproj --no-build | Run project tests (skip build) |
dotnet test --no-build --logger "console;verbosity=detailed" | Show ITestOutputHelper output |
dotnet test --no-build --filter "..." | Run filtered tests |
dotnet test --no-build --list-tests | List available tests without running |
| Operator | Meaning | Example |
|---|---|---|
= | Exact match | ClassName=MyTests |
!= | Not equal | Name!=SkipThis |
~ | Contains | Name~Create |
!~ | Does not contain | Name!~Integration |
| | OR | Name~Test1|Name~Test2 (note '|' is an escape for markdown) |
& | AND | Name~User&Category=Unit |
| Property | Description | Example |
|---|---|---|
FullyQualifiedName | Full test name with namespace | FullyQualifiedName~MyNamespace.MyClass |
DisplayName | Test display name | DisplayName=My_Test_Name |
Name | Method name | Name~ShouldCreate |
Category | Trait category | Category=Unit |
# Run tests containing "Create" in method name
dotnet test --no-build --filter "Name~Create"
# Run tests in a specific class
dotnet test --no-build --filter "ClassName=MyNamespace.UserServiceTests"
# Run tests matching namespace pattern
dotnet test --no-build --filter "FullyQualifiedName~MyApp.Tests.Unit"
# Run tests with specific trait
dotnet test --no-build --filter "Category=Integration"
# Exclude slow tests
dotnet test --no-build --filter "Category!=Slow"
# Combined: class AND method pattern
dotnet test --no-build --filter "ClassName=OrderTests&Name~Validate"
To see output from xUnit's ITestOutputHelper, use the console logger with detailed verbosity:
dotnet test --no-build --logger "console;verbosity=detailed"
This skill focuses on xUnit. For MSTest or NUnit, filter property names differ:
| Property | xUnit | MSTest | NUnit |
|---|---|---|---|
| Method name | Name | Name | Name |
| Class name | ClassName | ClassName | ClassName |
| Category/Trait | Category | TestCategory | Category |
| Priority | - | Priority | Priority |
For advanced debugging scenarios, load additional references:
--blameLoad these references when:
Invoke when the user needs to: