Testing is architecture
Testing reveals the shape of a system.
A design that is easy to exercise through stable public behavior is usually better separated and more understandable than one that requires extensive internal knowledge to test.
The layers I rely on
Section titled “The layers I rely on”- Unit tests for focused rules
- Contract tests for public schemas and protocols
- Integration tests through real ASP.NET Core hosts
- Snapshot tests for broad regression detection
- Architecture tests for solution and dependency constraints
- Generated samples to verify documentation and contracts
Frameworks should ship test affordances
Section titled “Frameworks should ship test affordances”A reusable platform should ship testing affordances alongside its runtime features. Product teams should not have to reverse-engineer internal infrastructure merely to verify their endpoints.
That idea is exactly why I built AspNetCore.Simple.MsTest.Sdk. A test should communicate the scenario, the input, the expected response and the expected protocol behavior — without pages of setup code:
await Client.AssertPostAsync<CreateRequest>( "/api/v1/capabilities", "Requests/Create.json", "Responses/Create.json", expectedStatusCode: HttpStatusCode.Created);