← ClaudeAtlas

dotnet10-testinglisted

Opinionated unit testing conventions for .NET 10 solutions built on Clean Architecture and Dapper: xUnit as the runner with `[Theory]` reserved for variants that differ only in input values, Moq for collaborators, Bogus fakers as dedicated builder classes in a shared test library, AwesomeAssertions for assertions, result objects instead of thrown exceptions, and repository tests that run against the real engine in a disposable container rather than a mocked connection. Use this skill whenever writing, reviewing, or restructuring tests for a .NET project: service tests, controller tests, repository tests, test data builders, mocking strategy, test naming, or test project layout. Also use when setting up a test project from scratch or deciding what deserves a test at all.
GuerthCastro/claude-skills-dotnet · ★ 1 · Testing & QA · score 75
Install: claude install-skill GuerthCastro/claude-skills-dotnet
# .NET Testing Conventions Author: Guerth Castro (github.com/GuerthCastro). Licensed under MIT. These conventions are extracted from a production suite of more than 600 tests, not invented for this document. They pair with `dotnet10-conventions`, which covers the production code these tests exercise. Placeholders: `Acme` is the company prefix, `Product` is the product or bounded context. ## Stack | Package | Role | | --- | --- | | `xunit` | The runner. `[Fact]` by default, `[Theory]` for the cases described below. | | `xunit.runner.visualstudio` | Test discovery in the IDE. `PrivateAssets=all`. | | `Microsoft.NET.Test.Sdk` | Required for `dotnet test`. | | `Moq` | Mocking interfaces. | | `Bogus` | Test data generation, in the shared test project only. | | `AwesomeAssertions` | Assertions. The MIT licensed fork of FluentAssertions, which went commercial at v8. | | `coverlet.collector` | Coverage collection. `PrivateAssets=all`. | Reference exactly these. A test project that also carries MSTest, NUnit, or a Dapper mocking package is carrying dead weight: pick one runner and delete the rest, because two runners in one project produce discovery ambiguity and a false impression of what the tests actually use. ## Style inside test projects Test code deviates from the production conventions in one specific way, and it is not about types or casing: `// Arrange`, `// Act`, and `// Assert` are the only comments allowed anywhere in the solution, and they live here. They mark str