Exemple #1
0
        public async Task SendHttpAsync_ThrowsTimeout_WhenOperationCanceled()
        {
            var handler = new TimeoutDelegatingHandler();
            var options = new DatasyncClientOptions {
                HttpPipeline = new HttpMessageHandler[] { handler }
            };
            var client  = new WrappedHttpClient(Endpoint, options);
            var request = new HttpRequestMessage(HttpMethod.Get, "");

            await Assert.ThrowsAsync <TimeoutException>(() => client.WrappedSendAsync(request)).ConfigureAwait(false);
        }
Exemple #2
0
 public async Task SendServiceAsync_ThrowsTimeout_WhenOperationCanceled()
 {
     var handler = new TimeoutDelegatingHandler();
     var options = new DatasyncClientOptions {
         HttpPipeline = new HttpMessageHandler[] { handler }
     };
     var client  = new WrappedHttpClient(Endpoint, options);
     var request = new ServiceRequest {
         Method = HttpMethod.Get, UriPathAndQuery = "/tables/movies/"
     };
     await Assert.ThrowsAsync <TimeoutException>(() => client.WrappedSendAsync(request)).ConfigureAwait(false);
 }