public async Task SendAsync_SlowGetRequestWithTimedCancellation_ExpectTaskCanceledException()
{
var handler = new WinHttpHandler();
TestControl.WinHttpReceiveResponse.Delay = 5000;
CancellationTokenSource cts = new CancellationTokenSource(50);
using (var client = new HttpClient(handler))
{
var request = new HttpRequestMessage(HttpMethod.Get, TestServer.FakeServerEndpoint);
await Assert.ThrowsAsync<TaskCanceledException>(() =>
client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cts.Token));
}
}