Removed unused usings, removed empty spaces, removed tons os warnings (#903)

This commit is contained in:
Thiago Loureiro
2019-05-28 11:00:54 +08:00
committed by GitHub
parent 4476f8273e
commit 5d82e68534
486 changed files with 3049 additions and 3143 deletions

View File

@ -1,13 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Memory;
using Moq;
using Ocelot.Middleware;
using Shouldly;
using System.Collections.Generic;
using TestStack.BDDfy;
using Xunit;
@ -22,7 +17,7 @@ namespace Ocelot.UnitTests.Middleware
public BaseUrlFinderTests()
{
_data = new List<KeyValuePair<string,string>>();
_data = new List<KeyValuePair<string, string>>();
}
[Fact]
@ -79,4 +74,4 @@ namespace Ocelot.UnitTests.Middleware
_result.ShouldBe(expected);
}
}
}
}

View File

@ -1,11 +1,11 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http;
using Moq;
using Ocelot.Configuration;
using Ocelot.Configuration.Builder;
using Ocelot.Middleware;
using Ocelot.Middleware.Multiplexer;
using Shouldly;
using System.Threading.Tasks;
using TestStack.BDDfy;
using Xunit;
@ -26,7 +26,7 @@ namespace Ocelot.UnitTests.Middleware
_factory = new Mock<IResponseAggregatorFactory>();
_aggregator = new Mock<IResponseAggregator>();
_context = new DownstreamContext(new DefaultHttpContext());
_pipeline = context => Task.FromResult(_count++);
_pipeline = context => Task.FromResult(_count++);
_factory.Setup(x => x.Get(It.IsAny<ReRoute>())).Returns(_aggregator.Object);
_multiplexer = new Multiplexer(_factory.Object);
}

View File

@ -1,11 +1,10 @@
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Http;
using Moq;
using Ocelot.Errors;
using Ocelot.Logging;
using Ocelot.Middleware;
using Ocelot.UnitTests.Responder;
using System.Collections.Generic;
using TestStack.BDDfy;
using Xunit;
@ -66,7 +65,7 @@ namespace Ocelot.UnitTests.Middleware
public class FakeMiddleware : OcelotMiddleware
{
public FakeMiddleware(IOcelotLogger logger)
public FakeMiddleware(IOcelotLogger logger)
: base(logger)
{
}

View File

@ -22,10 +22,10 @@ namespace Ocelot.UnitTests.Middleware
[Fact]
public void should_set_up_pipeline()
{
this.Given(_ => GivenTheDepedenciesAreSetUp())
.When(_ => WhenIBuild())
.Then(_ => ThenThePipelineIsBuilt())
.BDDfy();
this.Given(_ => GivenTheDepedenciesAreSetUp())
.When(_ => WhenIBuild())
.Then(_ => ThenThePipelineIsBuilt())
.BDDfy();
}
[Fact]

View File

@ -3,7 +3,6 @@ using System.Threading.Tasks;
namespace Ocelot.UnitTests.Middleware
{
using System.Collections.Generic;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.Internal;
using Microsoft.AspNetCore.Http;
@ -14,6 +13,7 @@ namespace Ocelot.UnitTests.Middleware
using Ocelot.Middleware;
using Ocelot.Middleware.Pipeline;
using Shouldly;
using System.Collections.Generic;
using TestStack.BDDfy;
using Xunit;
@ -79,8 +79,6 @@ namespace Ocelot.UnitTests.Middleware
del.Invoke(_downstreamContext);
}
private void ThenTheFuncIsInThePipeline()
{
_counter.ShouldBe(1);
@ -103,7 +101,7 @@ namespace Ocelot.UnitTests.Middleware
private readonly OcelotRequestDelegate _next;
public MultiParametersInvokeMiddleware(OcelotRequestDelegate next)
:base(new FakeLogger())
: base(new FakeLogger())
{
_next = next;
}
@ -115,7 +113,7 @@ namespace Ocelot.UnitTests.Middleware
}
}
class FakeLogger : IOcelotLogger
internal class FakeLogger : IOcelotLogger
{
public void LogCritical(string message, Exception exception)
{

View File

@ -1,12 +1,12 @@
namespace Ocelot.UnitTests.Middleware
{
using Moq;
using Ocelot.Configuration;
using Ocelot.Configuration.Builder;
using Ocelot.Middleware.Multiplexer;
using Shouldly;
using Xunit;
using Ocelot.Configuration;
using TestStack.BDDfy;
using Xunit;
public class ResponseAggregatorFactoryTests
{
@ -21,7 +21,7 @@ namespace Ocelot.UnitTests.Middleware
_aggregator = new SimpleJsonResponseAggregator();
_factory = new InMemoryResponseAggregatorFactory(_provider.Object, _aggregator);
}
[Fact]
public void should_return_simple_json_aggregator()
{

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text;
using Castle.Components.DictionaryAdapter;
using Castle.Components.DictionaryAdapter;
using Microsoft.AspNetCore.Http;
using Ocelot.Configuration;
using Ocelot.Configuration.Builder;
@ -13,6 +8,10 @@ using Ocelot.Middleware.Multiplexer;
using Ocelot.UnitTests.Responder;
using Ocelot.Values;
using Shouldly;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text;
using TestStack.BDDfy;
using Xunit;
@ -81,7 +80,6 @@ namespace Ocelot.UnitTests.Middleware
.BDDfy();
}
[Fact]
public void should_aggregate_n_responses_and_set_response_content_on_upstream_context()
{

View File

@ -1,9 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Moq;
using Ocelot.Configuration;
@ -13,6 +7,11 @@ using Ocelot.Middleware.Multiplexer;
using Ocelot.Responses;
using Ocelot.UnitTests.Responder;
using Shouldly;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using TestStack.BDDfy;
using Xunit;
@ -71,7 +70,7 @@ namespace Ocelot.UnitTests.Middleware
var contexts = new List<DownstreamContext>
{
new DownstreamContext(new DefaultHttpContext())
{
{
DownstreamResponse = new DownstreamResponse(new StringContent("Tom"), HttpStatusCode.OK, new List<KeyValuePair<string, IEnumerable<string>>>(), "some reason")
},
new DownstreamContext(new DefaultHttpContext())