.NET integration testing with ProtoTest
ProtoTest is an integration testing foundation for .NET 8, 9 and 10. The integrations a suite needs share one host, one context per test, one lifecycle and one trace. A single test can then write through REST, read back through GraphQL and check the database on the way.
Browse by task
| If you want to… | Read |
|---|---|
| understand how it fits together | Foundation |
| test an API | REST, GraphQL |
| test a UI | Web |
| stop hand-writing test data | Data |
| know what your suite misses | Coverage |
| debug a failure from CI | ProtoTrace |
| point a coding agent at a failing run | Agent workflows |
| keep traces and reports in CI | Continuous integration |
| add your own integration | Extending ProtoTest |
What it is made of
- Clients such as
Proto.Context.Rest(),.GraphQL(),.Web()and.Data(), sharing the test's context. - Attributes that hold reusable setup, such as a tenant or a signed-in user, and clean it up.
- Shape assertions that compare what matters in a response and report every mismatch at once.
- ProtoTrace, a portable
.prototracefile with each test's phases, operations, checks and files, plus coverage collectors for OpenAPI and GraphQL. - Runner packages for xUnit, NUnit, MSTest and TUnit.
See it in a real suite
Examples in these docs come from Northstar.ProtoTest, which tests the multi-tenant Northstar sample app across API, messaging, browser, database and workbook boundaries.
OpenCSMS, an independent EV charging platform, is the full product demo. Its suite runs against containers, an Aspire AppHost and a published stack, with faults injected on purpose. The Real systems lessons walk through it.
