Microsoft.AspNetCore.TestHost Namespace

Contains an in-memory implementation of IServer for use in writing tests.

Classes

ClientHandler

This adapts HttpRequestMessages to ASP.NET Core requests, dispatches them through the pipeline, and returns the associated HttpResponseMessage.

HostBuilderTestServerExtensions

Contains extensions for retrieving properties from IHost.

HttpResetTestException

Used to surface to the test client that the application invoked Reset(Int32)

RequestBuilder

Used to construct a HttpRequestMessage object.

TestServer

An IServer implementation for executing tests.

TestServerOptions

Options for the test server.

WebHostBuilderExtensions

Contains extensions for configuring the IWebHostBuilder instance.

WebHostBuilderFactory

A factory for creating IWebHostBuilder instances.

WebSocketClient

Provides a client for connecting over WebSockets to a test server.

Remarks

For more information about using TestServer, see Integration tests in ASP.NET Core.