Class MockHttpServer
Implements a very lightweight HTTP server suitable for locally mocking an HTTP based service.
note
This currently runs only on Windows.
Namespace: Neon.Xunit
Assembly: Neon.Xunit.dll
Syntax
public sealed class MockHttpServer
Constructors
MockHttpServer(string, Func<RequestContext, Task>)
Constuctor.
Declaration
public MockHttpServer(string urlPrefix, Func<RequestContext, Task> handler)
Parameters
Type | Name | Description |
---|---|---|
string | urlPrefix | Specifies the URL prefixes to be served. |
Func<RequestContext, Task> | handler | The custom asynchronous request handler. |
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()