mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 00:28:14 +08:00
Removed unused usings, removed empty spaces, removed tons os warnings (#903)
This commit is contained in:
@ -1,20 +1,20 @@
|
||||
using Moq;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
using Ocelot.Configuration;
|
||||
using Ocelot.Configuration.Builder;
|
||||
using Ocelot.Logging;
|
||||
using Ocelot.Middleware;
|
||||
using Ocelot.Request.Middleware;
|
||||
using Ocelot.Requester;
|
||||
using Ocelot.Responses;
|
||||
using Shouldly;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Ocelot.Configuration;
|
||||
using Ocelot.Configuration.Builder;
|
||||
using Ocelot.Middleware;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
using Shouldly;
|
||||
using Ocelot.Request.Middleware;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
|
||||
namespace Ocelot.UnitTests.Requester
|
||||
{
|
||||
@ -41,10 +41,10 @@ namespace Ocelot.UnitTests.Requester
|
||||
_cacheHandlers = new Mock<IHttpClientCache>();
|
||||
_mapper = new Mock<IExceptionToErrorMapper>();
|
||||
_httpClientRequester = new HttpClientHttpRequester(
|
||||
_loggerFactory.Object,
|
||||
_cacheHandlers.Object,
|
||||
_loggerFactory.Object,
|
||||
_cacheHandlers.Object,
|
||||
_factory.Object,
|
||||
_mapper.Object);
|
||||
_mapper.Object);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -69,9 +69,9 @@ namespace Ocelot.UnitTests.Requester
|
||||
DownstreamRequest = new DownstreamRequest(new HttpRequestMessage() { RequestUri = new Uri("http://www.bbc.co.uk") }),
|
||||
};
|
||||
|
||||
this.Given(x=>x.GivenTheRequestIs(context))
|
||||
this.Given(x => x.GivenTheRequestIs(context))
|
||||
.And(x => GivenTheHouseReturnsOkHandler())
|
||||
.When(x=>x.WhenIGetResponse())
|
||||
.When(x => x.WhenIGetResponse())
|
||||
.Then(x => x.ThenTheResponseIsCalledCorrectly())
|
||||
.BDDfy();
|
||||
}
|
||||
@ -136,7 +136,7 @@ namespace Ocelot.UnitTests.Requester
|
||||
|
||||
private void GivenTheRequestIs(DownstreamContext request)
|
||||
{
|
||||
_request = request;
|
||||
_request = request;
|
||||
}
|
||||
|
||||
private void WhenIGetResponse()
|
||||
@ -182,7 +182,7 @@ namespace Ocelot.UnitTests.Requester
|
||||
_mapper.Setup(x => x.Map(It.IsAny<Exception>())).Returns(new UnableToCompleteRequestError(new Exception()));
|
||||
}
|
||||
|
||||
class OkDelegatingHandler : DelegatingHandler
|
||||
private class OkDelegatingHandler : DelegatingHandler
|
||||
{
|
||||
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
|
||||
{
|
||||
@ -190,7 +190,7 @@ namespace Ocelot.UnitTests.Requester
|
||||
}
|
||||
}
|
||||
|
||||
class TimeoutDelegatingHandler : DelegatingHandler
|
||||
private class TimeoutDelegatingHandler : DelegatingHandler
|
||||
{
|
||||
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
|
||||
{
|
||||
@ -198,5 +198,5 @@ namespace Ocelot.UnitTests.Requester
|
||||
return new HttpResponseMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user