コード例 #1
0
        public async Task SendAsyncTest()
        {
            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "http://foo.com");

            ClientHttpCryptoHandler handler = _provider.GetService <ClientHttpCryptoHandler>();

            handler.InnerHandler = new TestHandler();
            HttpMessageInvoker  invoker = new HttpMessageInvoker(handler);
            HttpResponseMessage result  = await invoker.SendAsync(request, CancellationToken.None);

            Assert.Equal("test-response", await result.Content.ReadAsStringAsync());
        }
コード例 #2
0
        public void ClientHttpCryptoHandlerTest()
        {
            ClientHttpCryptoHandler handler = _provider.GetService <ClientHttpCryptoHandler>();

            Assert.NotNull(handler);
        }