FluentAssertions.Web
FluentAssertions.Web copied to clipboard
Add a MatchLocation and/or HaveLocation extension for redirect responses
Currently to check that redirect response that has the expected redirect location something like the following is tried:
response.Should().Be302Redirect()
.And.HaveHeader("Location")
.And.Match("/redirect-location");
What could ease would be:
to assert an exact match of the redirect header
response.Should().Be302Redirect()
.And.HaveLocation("/redirect-location?id=231");
or to have a wild card match
response.Should().Be302Redirect()
.And.MatchLocation("/redirect-location");