| File: TestResources\ReturningHttpClientHandler.cs | Web Access |
| Project: src\test\Libraries\Microsoft.AspNetCore.Testing.Tests\Microsoft.AspNetCore.Testing.Tests.csproj (Microsoft.AspNetCore.Testing.Tests) |
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; namespace Microsoft.AspNetCore.Testing.Test.TestResources; public class ReturningHttpClientHandler : HttpClientHandler { #if !NETCOREAPP3_1 protected override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken) { return new(HttpStatusCode.Gone); } #endif protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { return Task.FromResult(new HttpResponseMessage(HttpStatusCode.Gone)); } }