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.
View on GitHubNikiforovAll/claude-code-rules
handbook-dotnet
January 20, 2026
Select agents to install to:
npx add-skill https://github.com/NikiforovAll/claude-code-rules/blob/main/plugins/handbook-dotnet/skills/dotnet-test/SKILL.md -a claude-code --skill dotnet-testInstallation paths:
.claude/skills/dotnet-test/# .NET Test Runner Run .NET tests selectively using a build-first, test-targeted workflow optimized for development speed. ## Core Workflow Follow this workflow to run tests efficiently: ### Step 1: Build Solution First Build the entire solution with minimal output to catch compile errors early: ```bash dotnet build -p:WarningLevel=0 /clp:ErrorsOnly --verbosity minimal ``` ### Step 2: Run Specific Project Tests Run tests for the specific test project with `--no-build` to skip redundant compilation: ```bash dotnet test path/to/project --no-build --verbosity minimal ``` ### Step 3: Filter When Targeting Specific Tests Narrow down to specific tests using filter expressions: ```bash # 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. ## Quick Reference ### Commands | 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 test