Skip to content

reiugit/FluentAssertionsForHttpResponseMessages

Repository files navigation

FluentAssertions for 'HttpResponseMessages'

  1. Only with 'FluentAssertions':
ok.StatusCode.Should().Be(HttpStatusCode.OK);  // 200
ok.IsSuccessStatusCode.Should().BeTrue();      // 2xx
  1. Extended with 'HttpResponseMessageAssertions':
ok.Should().HaveStatusCode(HttpStatusCode.OK);  // 200
created.Should().BeSuccessful();                // 2xx
badRequest.Should().HaveClientError();          // 4xx
notFound.Should().HaveClientError();            // 4xx
internalServerError.Should().HaveServerError(); // 5xx

Releases

No releases published

Packages

No packages published

Languages