System.Net.Http.OnSendingHeadersTests.Using_HttpListener_then_should_have_2_cookies C# (CSharp) Method

Using_HttpListener_then_should_have_2_cookies() private method

private Using_HttpListener_then_should_have_2_cookies ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
        public async Task Using_HttpListener_then_should_have_2_cookies()
        {
            using(WebApp.Start(_uri.ToString(), a => a.Run(ctx => _appFunc(ctx.Environment))))
            {
                var handler = new HttpClientHandler
                {
                    UseCookies = true
                };
                using (var client = new HttpClient(handler)
                {
                    BaseAddress = _uri
                })
                {
                    var response = await client.GetAsync(_uri);

                    response.Headers.GetValues("Set-Cookie")
                        .Count()
                        .ShouldBe(2);
                }
            }
        }