public async Task Can_set_redirect_limit()
{
_handler.AutoRedirectLimit = 10;
using (var client = new HttpClient(_handler)
{
BaseAddress = new Uri("http://localhost")
})
{
Func<Task> act = () => client.GetAsync("/redirect-loop");
var exception = await act.ShouldThrowAsync<InvalidOperationException>();
exception.Message.ShouldContain("Limit = 10");
}
}