dotnet10-testinglisted
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