コード例 #1
0
 /// <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)));
 }
コード例 #2
0
 /// <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()));
 }
コード例 #3
0
 /// <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);
 });