System.Net.Http.AutoRedirectTests.When_caught_in_a_redirect_loop_should_throw C# (CSharp) Method

When_caught_in_a_redirect_loop_should_throw() private method

private When_caught_in_a_redirect_loop_should_throw ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
        public async Task When_caught_in_a_redirect_loop_should_throw()
        {
            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 = 20");
            }
        }