/// <summary> /// Sets up a response with an empty body for SendAsync /// </summary> /// <param name="mock"></param> /// <param name="statusCode">The response status code</param> /// <returns></returns> public static IReturnsResult <TestableHttpMessageHandler> RespondsWith(this IReturns <TestableHttpMessageHandler, Task <HttpResponseMessage> > mock, HttpStatusCode statusCode) => mock.RespondsWith(statusCode, (object)null);
/// <summary> /// Sets up a response with status code 200 for SendAsync /// </summary> /// <typeparam name="T"></typeparam> /// <param name="mock"></param> /// <param name="responseBody">Object to be rendered as Json in the response body</param> /// <returns></returns> public static IReturnsResult <TestableHttpMessageHandler> RespondsWith <T>(this IReturns <TestableHttpMessageHandler, Task <HttpResponseMessage> > mock, T responseBody) => mock.RespondsWith(HttpStatusCode.OK, responseBody);
/// <summary> /// Sets up a response with status code 200 and an empty body for SendAsync /// </summary> /// <param name="mock"></param> /// <returns></returns> public static IReturnsResult <TestableHttpMessageHandler> RespondsWithDefault(this IReturns <TestableHttpMessageHandler, Task <HttpResponseMessage> > mock) => mock.RespondsWith(HttpStatusCode.OK);