mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-25 10:58:20 -10:00
Commit migrated from https://github.com/dotnet/corefx/commit/7cad8486cbabbce0236bdf530e30db7036335524
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using System;
|
|
using System.Net;
|
|
using System.Net.Http;
|
|
using System.Net.Tests;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace System.Net.Http.Functional.Tests
|
|
{
|
|
public class HttpClientTest
|
|
{
|
|
[Fact]
|
|
[OuterLoop]
|
|
public void Timeout_SetTo60AndGetResponseFromServerWhichTakes40_Success()
|
|
{
|
|
// TODO: This server path will change once the final test infrastructure is in place (Issue #1477).
|
|
const string SlowServer = "http://httpbin.org/drip?numbytes=1&duration=1&delay=40&code=200";
|
|
|
|
using (var client = new HttpClient())
|
|
{
|
|
client.Timeout = TimeSpan.FromSeconds(60);
|
|
var response = client.GetAsync(SlowServer).GetAwaiter().GetResult();
|
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
|
}
|
|
}
|
|
}
|
|
}
|