Namespace ProtoTest.AspNetCore

Classes

FailDependencyAttribute<TService>

Fails a dependency of the application under test for one test, for the error paths: resolving the service throws instead of serving an instance. The test runs against a dedicated server built with the failure before it starts, so the run's shared server never sees it and the next test starts clean. The test skips when the application is not hosted in-process, mirroring RequiresInProcessAttribute.

ProtoExecutionContextExtensions

Provides ASP.NET Core extension methods on ProtoExecutionContext.

ProtoHostBuilderExtensions

Provides extension methods for IProtoHostBuilder to configure ASP.NET Core test hosts.

ProtoTestContextPropagation

Propagates the test's context onto a request an in-process transport opens itself. A real HTTP handler propagates the W3C trace context itself, but the TestServer handler bypasses the HTTP diagnostics, so an in-process request carries the ambient trace context explicitly; it also carries the test's id, which is how the application's TimeProvider finds the test's clock on a request flow that no longer has the test's ambient context.

ProtoTestHost

The low-ceremony composition for a suite whose subject is one ASP.NET Core application: register it in-process under the default application name, and compose its protocol registrations on the same call.

ReplaceServiceAttribute<TService>

Substitutes a service in the application under test for one test. The test runs against a dedicated server built with the replacement before it starts, so the run's shared server never sees the substitution and the next test starts clean. The test skips when the application is not hosted in-process, mirroring RequiresInProcessAttribute.

TestUserAuthenticationExtensions

Wires the built-in test user into an in-process application: the shipped handler reads the HeaderName header a test's [SignedInAs] identity travels in and authenticates the request as that user, so the application's own authorization - plain [Authorize], role checks, policies - sees the test user as its principal. The scheme becomes the application's default, replacing whatever the application configured: register it only where a test user should stand in for the application's own authentication, never when the test's subject is that authentication itself. The header only exists while the application runs in-process.

Enums

AspNetCoreServerLifetime

Controls how long an in-process ASP.NET Core application lives.