mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 18:32:51 +08:00
Fix more test-related build warnings
This commit is contained in:
parent
84743ede0e
commit
c70a90f415
@ -15,7 +15,6 @@ using TestStack.BDDfy;
|
|||||||
using Xunit;
|
using Xunit;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Threading;
|
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
|
|
||||||
namespace Ocelot.IntegrationTests
|
namespace Ocelot.IntegrationTests
|
||||||
@ -23,11 +22,9 @@ namespace Ocelot.IntegrationTests
|
|||||||
public class ThreadSafeHeadersTests : IDisposable
|
public class ThreadSafeHeadersTests : IDisposable
|
||||||
{
|
{
|
||||||
private readonly HttpClient _httpClient;
|
private readonly HttpClient _httpClient;
|
||||||
private HttpResponseMessage _response;
|
|
||||||
private IWebHost _builder;
|
private IWebHost _builder;
|
||||||
private IWebHostBuilder _webHostBuilder;
|
private IWebHostBuilder _webHostBuilder;
|
||||||
private readonly string _ocelotBaseUrl;
|
private readonly string _ocelotBaseUrl;
|
||||||
private BearerToken _token;
|
|
||||||
private IWebHost _downstreamBuilder;
|
private IWebHost _downstreamBuilder;
|
||||||
private readonly Random _random;
|
private readonly Random _random;
|
||||||
private readonly ConcurrentBag<ThreadSafeHeadersTestResult> _results;
|
private readonly ConcurrentBag<ThreadSafeHeadersTestResult> _results;
|
||||||
@ -135,7 +132,7 @@ namespace Ocelot.IntegrationTests
|
|||||||
text = File.ReadAllText(configurationPath);
|
text = File.ReadAllText(configurationPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void WhenIGetUrlOnTheApiGatewayMultipleTimesWithDifferentHeaderValues(string url, int times)
|
private void WhenIGetUrlOnTheApiGatewayMultipleTimesWithDifferentHeaderValues(string url, int times)
|
||||||
{
|
{
|
||||||
var tasks = new Task[times];
|
var tasks = new Task[times];
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ using Ocelot.Logging;
|
|||||||
using Shouldly;
|
using Shouldly;
|
||||||
using TestStack.BDDfy;
|
using TestStack.BDDfy;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ocelot.UnitTests.Errors
|
namespace Ocelot.UnitTests.Errors
|
||||||
{
|
{
|
||||||
@ -67,6 +68,7 @@ namespace Ocelot.UnitTests.Errors
|
|||||||
app.UseExceptionHandlerMiddleware();
|
app.UseExceptionHandlerMiddleware();
|
||||||
app.Use(async (context, next) =>
|
app.Use(async (context, next) =>
|
||||||
{
|
{
|
||||||
|
await Task.CompletedTask;
|
||||||
throw new Exception("BOOM");
|
throw new Exception("BOOM");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -109,6 +111,7 @@ namespace Ocelot.UnitTests.Errors
|
|||||||
app.UseExceptionHandlerMiddleware();
|
app.UseExceptionHandlerMiddleware();
|
||||||
app.Run(async context =>
|
app.Run(async context =>
|
||||||
{
|
{
|
||||||
|
await Task.CompletedTask;
|
||||||
context.Response.StatusCode = 200;
|
context.Response.StatusCode = 200;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user