/// <summary> /// Asserts the status code of the response /// </summary> /// <param name="request">The Solid.Http request</param> /// <param name="statusCode">The expected status code</param> /// <returns>The fluent assertion</returns> public static Assertion ShouldRespondWith(this ISolidHttpRequest request, int statusCode) { return(request.Should(response => response.AssertStatusCode(statusCode))); }
/// <summary> /// Asserts that the status code of the response is successful (200-299) /// </summary> /// <param name="request">The Solid.Http request</param> /// <returns>The fluent assertion</returns> public static Assertion ShouldRespondSuccessfully(this ISolidHttpRequest request) { return(request.Should(response => response.AssertSuccessful())); }
/// <summary> /// Performs an assertion against the http response message /// </summary> /// <param name="request">The Solid.Http request</param> /// <param name="assert">The assertion action</param> /// <returns>The fluent assertion</returns> public static Assertion Should(this ISolidHttpRequest request, Action <HttpResponseMessage> assert) => request.Should(response => { assert(response); return(Task.CompletedTask); });