From c70a90f415a048cd8f23b9147e26f9ab4b1a4ce1 Mon Sep 17 00:00:00 2001 From: Philip Wood Date: Tue, 18 Jul 2017 10:20:59 +0100 Subject: [PATCH] Fix more test-related build warnings --- test/Ocelot.IntegrationTests/ThreadSafeHeadersTests.cs | 7 ++----- .../Errors/ExceptionHandlerMiddlewareTests.cs | 3 +++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/Ocelot.IntegrationTests/ThreadSafeHeadersTests.cs b/test/Ocelot.IntegrationTests/ThreadSafeHeadersTests.cs index 2512a87d..2922d92c 100644 --- a/test/Ocelot.IntegrationTests/ThreadSafeHeadersTests.cs +++ b/test/Ocelot.IntegrationTests/ThreadSafeHeadersTests.cs @@ -15,7 +15,6 @@ using TestStack.BDDfy; using Xunit; using Microsoft.AspNetCore.Http; using System.Threading.Tasks; -using System.Threading; using System.Collections.Concurrent; namespace Ocelot.IntegrationTests @@ -23,11 +22,9 @@ namespace Ocelot.IntegrationTests public class ThreadSafeHeadersTests : IDisposable { private readonly HttpClient _httpClient; - private HttpResponseMessage _response; private IWebHost _builder; private IWebHostBuilder _webHostBuilder; private readonly string _ocelotBaseUrl; - private BearerToken _token; private IWebHost _downstreamBuilder; private readonly Random _random; private readonly ConcurrentBag _results; @@ -61,7 +58,7 @@ namespace Ocelot.IntegrationTests }; this.Given(x => GivenThereIsAConfiguration(configuration)) - .And(x => GivenThereIsAServiceRunningOn("http://localhost:51879")) + .And(x => GivenThereIsAServiceRunningOn("http://localhost:51879")) .And(x => GivenOcelotIsRunning()) .When(x => WhenIGetUrlOnTheApiGatewayMultipleTimesWithDifferentHeaderValues("/", 300)) .Then(x => ThenTheSameHeaderValuesAreReturnedByTheDownstreamService()) @@ -135,7 +132,7 @@ namespace Ocelot.IntegrationTests text = File.ReadAllText(configurationPath); } - public void WhenIGetUrlOnTheApiGatewayMultipleTimesWithDifferentHeaderValues(string url, int times) + private void WhenIGetUrlOnTheApiGatewayMultipleTimesWithDifferentHeaderValues(string url, int times) { var tasks = new Task[times]; diff --git a/test/Ocelot.UnitTests/Errors/ExceptionHandlerMiddlewareTests.cs b/test/Ocelot.UnitTests/Errors/ExceptionHandlerMiddlewareTests.cs index 8584f106..ac786ec1 100644 --- a/test/Ocelot.UnitTests/Errors/ExceptionHandlerMiddlewareTests.cs +++ b/test/Ocelot.UnitTests/Errors/ExceptionHandlerMiddlewareTests.cs @@ -13,6 +13,7 @@ using Ocelot.Logging; using Shouldly; using TestStack.BDDfy; using Xunit; +using System.Threading.Tasks; namespace Ocelot.UnitTests.Errors { @@ -67,6 +68,7 @@ namespace Ocelot.UnitTests.Errors app.UseExceptionHandlerMiddleware(); app.Use(async (context, next) => { + await Task.CompletedTask; throw new Exception("BOOM"); }); }); @@ -109,6 +111,7 @@ namespace Ocelot.UnitTests.Errors app.UseExceptionHandlerMiddleware(); app.Run(async context => { + await Task.CompletedTask; context.Response.StatusCode = 200; }); });