Method Respond
Respond(Func<HttpRequestMessage, bool>, Func<HttpRequestMessage, HttpResponseMessage>, int)
Answers the next requests that match with a response of the test's own instead of sending them, such as a 503 with a Retry-After
header or a proxy's error page.
Declaration
public FaultInjectionHandler Respond(Func<HttpRequestMessage, bool> predicate, Func<HttpRequestMessage, HttpResponseMessage> createResponse, int count = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<HttpRequestMessage, bool> | predicate | Selects the requests to answer. |
| Func<HttpRequestMessage, HttpResponseMessage> | createResponse | Creates the response to a request. |
| int | count | The number of requests to answer. |
Returns
| Type | Description |
|---|---|
| FaultInjectionHandler | This handler. |