Run .NET tests using dotnet CLI. Use when task involves executing unit tests, generating code coverage reports, or running benchmarks.
npx playbooks add skill giantcroissant-lunar/lunar-snake-hub --skill dotnet-test
> Goal: Guide agent to the exact testing procedure needed.
references/run-unit-tests.mdreferences/generate-coverage.mdreferences/run-benchmarks.mdNOT for: building code (dotnet-build), formatting (code-format), or static analysis (code-analyze)
Inputs: target (all/project/specific), configuration (Debug/Release), coverage (true/false), project_path (default: all test projects)
Outputs: Test results (pass/fail counts), coverage reports (if requested), benchmark results, exit code (0=success)
Guardrails: Operate in ./dotnet only, report failures clearly, never skip tests without permission
1. Run Unit Tests → [references/run-unit-tests.md](references/run-unit-tests.md)
2. Generate Coverage Report → [references/generate-coverage.md](references/generate-coverage.md)
3. Run Benchmarks → [references/run-benchmarks.md](references/run-benchmarks.md)
cd ./dotnet
dotnet test
cd ./dotnet
dotnet test --verbosity normal
cd ./dotnet
dotnet test console-app.Tests/PigeonPea.Console.Tests.csproj
cd ./dotnet
dotnet test --collect:"XPlat Code Coverage"
cd ./dotnet
dotnet test --collect:"XPlat Code Coverage" --results-directory ./TestResults
# Coverage file: ./TestResults/{guid}/coverage.cobertura.xml
cd ./dotnet
dotnet test --filter "FullyQualifiedName~FrameTests"
cd ./dotnet
dotnet test --filter "Category=Unit"
cd ./dotnet
dotnet test --configuration Release
cd ./dotnet/benchmarks
dotnet run -c Release
Tests fail: Check test output for assertion failures. See references/run-unit-tests.md for debugging.
Coverage not generated: Ensure coverlet.collector is installed. See references/generate-coverage.md.
Benchmarks fail to run: Use Release configuration. See references/run-benchmarks.md.
Slow test execution: Filter tests, run in parallel, or use --no-build after building.
Test discovery fails: Check project references, ensure test framework packages are installed.
Passed! - Failed: 0, Passed: 42, Skipped: 0, Total: 42
Test artifacts in: ./dotnet/TestResults/
Coverage report in: ./dotnet/TestResults/coverage.cobertura.xml
Before testing: dotnet-build (ensure code is built)
After testing: code-analyze (static analysis), code-review (quality checks)
This repository uses:
./dotnet/README.md](../../../dotnet/README.md) - Project structure./dotnet/ARCHITECTURE.md](../../../dotnet/ARCHITECTURE.md) - Architecture.pre-commit-config.yaml](../../../.pre-commit-config.yaml) - Pre-commit hooksdotnet-build skill](../dotnet-build/SKILL.md) - Build skillWeekly roundup of top Claude Code skills, MCP servers, and AI coding tips.