Skip to main content

ProtoTest

ProtoTest is a foundation for integration testing on .NET 8, 9 and 10. You choose the integrations a suite needs, and they share the same host, test context, lifecycle and trace.

That lets one test write through REST and read through GraphQL, or combine API, browser, database, messaging and file checks when that is useful.

ProtoTest 1.0 packages are available on NuGet. The template targets net10.0 by default; pass --framework net8.0 or net9.0 to use another supported target.

Main pieces

  • Attributes can hold reusable setup such as creating a tenant or signing in a user.
  • Clients such as Proto.Context.Rest(), .GraphQL(), .Web() and .Data() use the same per-test context.
  • Shape assertions compare the parts of a response that matter to the test and report all mismatches together.
  • Coverage collectors report which parts of an OpenAPI document or GraphQL schema were called and checked.
  • ProtoTrace records lifecycle phases, operations, checks and artifacts in a portable .prototrace file.
  • Runner packages connect the same runtime to xUnit, NUnit, MSTest and TUnit.

Where to start

If you want to…Read
try itInstallation, then Your first test
understand how it fits togetherFoundation
test an APIREST, GraphQL
test a UIWeb
stop hand-writing test dataData
know what your suite missesCoverage
debug a failure from CIProtoTrace
keep traces and reports in CIContinuous integration
add your own integrationExtending ProtoTest

See it in a real suite

The repository contains Northstar, a multi-tenant sample application, and a ProtoTest.Demo suite that tests it across API, messaging, browser, database and workbook boundaries. Examples throughout these docs come from that suite.