plugins/handbook-dotnet/skills/dotnet-test/SKILL.md
This skill should be used when running .NET tests selectively with a build-first, test-targeted workflow. Use it for running tests with xUnit focus.
npx skillsauth add nikiforovall/claude-code-rules dotnet-testInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run .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 minimal
Run tests for the specific test project with --no-build to skip redundant compilation:
dotnet test path/to/project --no-build --verbosity minimal
Narrow down to specific tests using filter expressions:
# By method name using FullyQualifiedName (recommended)
dotnet test --no-build --filter "FullyQualifiedName~MyTestMethod"
# By class name using FullyQualifiedName (recommended)
dotnet test --no-build --filter "FullyQualifiedName~MyTestClass"
# By parameter values in Theory tests (xUnit)
dotnet test --no-build --filter "DisplayName~paramValue"
# Combined filters
dotnet test --no-build --filter "FullyQualifiedName~Create|FullyQualifiedName~Update"
Note: Properties Name~ and ClassName= may not work reliably. Use FullyQualifiedName~ instead.
| Command | Purpose |
| -------------------------------------------------------------------- | ------------------------------------ |
| dotnet build -p:WarningLevel=0 /clp:ErrorsOnly --verbosity minimal | 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 | Reliability | Example |
| -------------------- | ---------------------------------------------- | ------------ | ------------------------------------------------------ |
| FullyQualifiedName | Full test name with namespace | ✅ Reliable | FullyQualifiedName~MyNamespace.MyClass |
| DisplayName | Test display name (includes Theory parameters) | ✅ Reliable | DisplayName~My_Test_Name or DisplayName~paramValue |
| Name | Method name | ⚠️ Unreliable | Use FullyQualifiedName~ instead |
| ClassName | Class name | ⚠️ Unreliable | Use FullyQualifiedName~ instead |
| Category | Trait category | ✅ Reliable | Category=Unit |
When to use DisplayName: Essential for filtering Theory tests by their parameter values. xUnit includes all parameter values in the DisplayName (e.g., MyTest(username: "admin", age: 30)), making it ideal for running specific test cases. See references/theory-parameter-filtering.md for detailed guidance.
# Run tests containing "Create" in method name
dotnet test --no-build --filter "FullyQualifiedName~Create"
# Run tests in a specific class
dotnet test --no-build --filter "FullyQualifiedName~UserServiceTests"
# Run tests matching namespace pattern
dotnet test --no-build --filter "FullyQualifiedName~MyApp.Tests.Unit"
# Run Theory tests with specific parameter value
dotnet test --no-build --filter "DisplayName~admin_user"
# 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 parameter value (Theory tests)
dotnet test --no-build --filter "FullyQualifiedName~OrderTests&DisplayName~USD"
# Multiple parameter values (OR condition)
dotnet test --no-build --filter "DisplayName~EUR|DisplayName~GBP"
To see output from xUnit's ITestOutputHelper, use the console logger with detailed verbosity:
dotnet test --no-build --logger "console;verbosity=detailed"
Verbosity levels for dotnet test:
| Level | Flag | Description |
| ---------- | --------- | ------------------------------- |
| quiet | -v q | Minimal output (pass/fail only) |
| minimal | -v m | Clean summary, no test output |
| normal | -v n | Default, shows discovered tests |
| detailed | -v d | Shows more details |
| diagnostic | -v diag | Most verbose |
To see test output, use grep to filter out discovery messages (for xUnit):
dotnet test --no-build --logger "console;verbosity=detailed" 2>&1 | grep -v "Discovered \[execution\]"
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 scenarios, load additional references:
--blameLoad these references when:
Invoke when the user needs to:
development
Generate beautiful, self-contained HTML pages that visually explain systems, code changes, plans, and data. Use when the user asks for a diagram, architecture overview, diff review, plan review, project recap, comparison table, or any visual explanation of technical concepts. Also use proactively when you are about to render a complex ASCII table (4+ rows or 3+ columns) — present it as a styled HTML page instead.
tools
Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line. Use this skill when the user needs to interact with GitLab resources or perform GitLab workflows.
tools
--- name: reflect description: Analyze a Claude Code session for "wrong-turn" moments (corrections, retries, waste, reversals, dead-ends) and produce an interactive HTML dashboard with copy-able recommendations (CLAUDE.md rules, docs, scripts, hooks, memory entries, sub-skills, etc.) that would help future agents reach the goal faster. Defaults to reflecting on the current in-context session; optionally accepts a session ID or JSONL path. Use when the user invokes /reflect or asks to learn from
tools
--- name: reflect-tree description: Visualize a Claude Code session as a quest/skill tree — a navigable SVG graph where nodes are turns and edges show flow, with distinct visual encoding for normal flow, dead-ends, corrections, retries, reversals, and backtracking. Sibling to /reflect (which produces an incidents+recommendations dashboard); this one shows the journey itself. Defaults to the current in-context session; optionally accepts a session ID or JSONL path. Use when the user invokes /refl