System.Net.Http.OwinHttpMessageHandlerTests.When_changing_cookie_container_after_initial_operation_then_should_throw C# (CSharp) Метод

When_changing_cookie_container_after_initial_operation_then_should_throw() приватный Метод

private When_changing_cookie_container_after_initial_operation_then_should_throw ( ) : System.Threading.Tasks.Task
Результат System.Threading.Tasks.Task
        public async Task When_changing_cookie_container_after_initial_operation_then_should_throw()
        {
            var handler = new OwinHttpMessageHandler(AppFuncHelpers.NoopAppFunc);
            using (var client = new HttpClient(handler))
            {
                await client.GetAsync("http://localhost/");
            }

            Action act = () => { handler.CookieContainer = new CookieContainer(); };

            act.ShouldThrow<InvalidOperationException>();
        }