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,31 +1,37 @@
using System.Net.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http;
using Ocelot.Cache;
using Ocelot.Middleware;
using Shouldly;
using System.Net.Http;
using TestStack.BDDfy;
using Xunit;
namespace Ocelot.UnitTests.Cache {
public class CacheKeyGeneratorTests {
namespace Ocelot.UnitTests.Cache
{
public class CacheKeyGeneratorTests
{
private readonly ICacheKeyGenerator _cacheKeyGenerator;
private readonly DownstreamContext _downstreamContext;
public CacheKeyGeneratorTests() {
public CacheKeyGeneratorTests()
{
_cacheKeyGenerator = new CacheKeyGenerator();
_cacheKeyGenerator = new CacheKeyGenerator();
_downstreamContext = new DownstreamContext(new DefaultHttpContext()) {
_downstreamContext = new DownstreamContext(new DefaultHttpContext())
{
DownstreamRequest = new Ocelot.Request.Middleware.DownstreamRequest(new HttpRequestMessage(HttpMethod.Get, "https://some.url/blah?abcd=123"))
};
}
[Fact]
public void should_generate_cache_key_from_context() {
public void should_generate_cache_key_from_context()
{
this.Given(x => x.GivenCacheKeyFromContext(_downstreamContext))
.BDDfy();
}
private void GivenCacheKeyFromContext(DownstreamContext context) {
private void GivenCacheKeyFromContext(DownstreamContext context)
{
string generatedCacheKey = _cacheKeyGenerator.GenerateRequestCacheKey(context);
string cachekey = MD5Helper.GenerateMd5("GET-https://some.url/blah?abcd=123");
generatedCacheKey.ShouldBe(cachekey);