Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Microsoft.AspNetCore.TestHost Namespace

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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

Classes

Name Description
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.


Feedback

Was this page helpful?