Class MessageHandlerFactory
Static factory class that creates HttpMessageHandler instances for unit tests
Inherited Members
Namespace: FakeHttp
Assembly: FakeHttp.dll
Syntax
public static class MessageHandlerFactory
Properties
| Improve this Doc View SourceMode
Controls what type of HttpMessageHandler to create by default
Declaration
public static MessageHandlerMode Mode { get; set; }
Property Value
Type | Description |
---|---|
MessageHandlerMode |
Methods
| Improve this Doc View SourceCreateMessageHandler(IReadOnlyResources)
Create an HttpMessageHandler.
Declaration
public static HttpMessageHandler CreateMessageHandler(IReadOnlyResources resources)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyResources | resources | Instance where faked responses are stored |
Returns
Type | Description |
---|---|
HttpMessageHandler |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
CreateMessageHandler(IReadOnlyResources, IResponseCallbacks)
Create an HttpMessageHandler.
Declaration
public static HttpMessageHandler CreateMessageHandler(IReadOnlyResources resources, IResponseCallbacks callbacks)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyResources | resources | Instance where faked responses are stored |
IResponseCallbacks | callbacks |
Returns
Type | Description |
---|---|
HttpMessageHandler | A HttpMessageHandler appropriate for the current Mode |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | |
ArgumentNullException |
CreateMessageHandler(IResources)
Create an HttpMessageHandler.
Declaration
public static HttpMessageHandler CreateMessageHandler(IResources resources)
Parameters
Type | Name | Description |
---|---|---|
IResources | resources | Instance where faked responses are stored |
Returns
Type | Description |
---|---|
HttpMessageHandler | A HttpMessageHandler appropriate for the current Mode |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
CreateMessageHandler(IResources, IResponseCallbacks)
Create an HttpMessageHandler.
Declaration
public static HttpMessageHandler CreateMessageHandler(IResources resources, IResponseCallbacks callbacks)
Parameters
Type | Name | Description |
---|---|---|
IResources | resources | Instance where faked responses are stored |
IResponseCallbacks | callbacks |
Returns
Type | Description |
---|---|
HttpMessageHandler | A HttpMessageHandler appropriate for the current Mode |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |