Http extensions for FluentAssertions
https://balanikas.github.io/FluentAssertions.Http/api/index.html
var response = await _factory.CreateClient().GetAsync("/api/customers");
var expected = new CustomerModel();
//assert content headers
response.Should().HaveContentHeader("X-Custom-Header");
response.Should().HaveContentHeaderValue(HttpResponseHeader.ContentType, "application/json; charset=utf-8");
response.Should().HaveContentHeaderValues(HttpResponseHeader.Allow, new[] { "GET", "PUT" });
//assert response headers
response.Should().HaveResponseHeader("X-Custom-Header");
response.Should().HaveResponseHeaderValue(HttpResponseHeader.AcceptRanges, "range1");
response.Should().HaveResponseHeaderValues(HttpResponseHeader.AcceptRanges, new []{"range1","range2"});
//assert string content
response.Should().HaveContentMatching(x => x.StartsWith("hello"));
response.Should().HaveContent("hello world");
//assert typed content
response.Should().HaveContentMatching<CustomerModel>(x => x.Name == "Alex" && x.Addresses.Count == 2);
response.Should().HaveContent<CustomerModel>(expected);
response.Should().HaveContent<CustomerModel>(expected, o => o.Excluding(x => x.Id));
response.Should()
.HaveResponseHeader("X-Custom-Header")
.And
.HaveContent(expected, options => options.Excluding(x => x.Id));