2020-02-15 23:28:20 +00:00
|
|
|
|
using System.Net.Http;
|
|
|
|
|
using System.Threading.Tasks;
|
2020-03-26 04:25:48 +00:00
|
|
|
|
using Xunit;
|
2020-02-15 23:28:20 +00:00
|
|
|
|
|
2020-03-26 04:25:48 +00:00
|
|
|
|
namespace Wabbajack.Common.Test
|
2020-02-15 23:28:20 +00:00
|
|
|
|
{
|
|
|
|
|
public class HttpClientTests
|
|
|
|
|
{
|
2020-03-26 04:25:48 +00:00
|
|
|
|
[Fact]
|
2020-02-15 23:28:20 +00:00
|
|
|
|
public async Task DoesntReuseHttpMessages()
|
|
|
|
|
{
|
|
|
|
|
var client = new Common.Http.Client();
|
|
|
|
|
// If we reuse the HTTP message this will throw a invalid operation exception
|
2020-03-26 04:25:48 +00:00
|
|
|
|
await Assert.ThrowsAsync<HttpRequestException>(async () => await client.GetAsync("http://blerg.blaz.bloz.buz"));
|
2020-02-15 23:28:20 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|