mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 09:38:14 +08:00
reorganised project so its a bit more vertical for features
This commit is contained in:
@ -3,6 +3,9 @@ using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
using Ocelot.Library.Authentication.Handler;
|
||||
using Ocelot.Library.Authentication.Handler.Creator;
|
||||
using Ocelot.Library.Authentication.Handler.Factory;
|
||||
using Shouldly;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
@ -6,19 +6,18 @@ using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.TestHost;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Moq;
|
||||
using Ocelot.Library.Authentication.Handler.Factory;
|
||||
using Ocelot.Library.Authentication.Middleware;
|
||||
using Ocelot.Library.Configuration.Builder;
|
||||
using Ocelot.Library.DownstreamRouteFinder;
|
||||
using Ocelot.Library.DownstreamRouteFinder.UrlMatcher;
|
||||
using Ocelot.Library.Responses;
|
||||
using Ocelot.Library.ScopedData;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
namespace Ocelot.UnitTests.Middleware
|
||||
namespace Ocelot.UnitTests.Authentication
|
||||
{
|
||||
using Library.Authentication;
|
||||
using Library.DownstreamRouteFinder;
|
||||
using Library.Middleware;
|
||||
using Library.Repository;
|
||||
using Library.Responses;
|
||||
using Library.UrlMatcher;
|
||||
|
||||
public class AuthenticationMiddlewareTests : IDisposable
|
||||
{
|
||||
private readonly Mock<IScopedRequestDataRepository> _scopedRepository;
|
@ -3,13 +3,12 @@ using System.Linq;
|
||||
using Ocelot.Library.Configuration;
|
||||
using Ocelot.Library.Configuration.Parser;
|
||||
using Ocelot.Library.Errors;
|
||||
using Ocelot.Library.RequestBuilder;
|
||||
using Ocelot.Library.Responses;
|
||||
using Shouldly;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
namespace Ocelot.UnitTests.RequestBuilder
|
||||
namespace Ocelot.UnitTests.Configuration
|
||||
{
|
||||
public class ConfigurationHeadersExtractorTests
|
||||
{
|
@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Ocelot.Library.Configuration.Validator;
|
||||
using Shouldly;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
@ -3,8 +3,10 @@ using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Moq;
|
||||
using Ocelot.Library.Configuration.Builder;
|
||||
using Ocelot.Library.Configuration.Creator;
|
||||
using Ocelot.Library.Configuration.Parser;
|
||||
using Ocelot.Library.Configuration.Repository;
|
||||
using Ocelot.Library.Configuration.Validator;
|
||||
using Ocelot.Library.RequestBuilder;
|
||||
using Shouldly;
|
||||
using TestStack.BDDfy;
|
||||
|
@ -7,17 +7,17 @@ using Microsoft.AspNetCore.TestHost;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Moq;
|
||||
using Ocelot.Library.Configuration.Builder;
|
||||
using Ocelot.Library.DownstreamRouteFinder;
|
||||
using Ocelot.Library.DownstreamRouteFinder.Finder;
|
||||
using Ocelot.Library.DownstreamRouteFinder.Middleware;
|
||||
using Ocelot.Library.DownstreamRouteFinder.UrlMatcher;
|
||||
using Ocelot.Library.Responses;
|
||||
using Ocelot.Library.ScopedData;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
namespace Ocelot.UnitTests.Middleware
|
||||
namespace Ocelot.UnitTests.DownstreamRouteFinder
|
||||
{
|
||||
using Library.DownstreamRouteFinder;
|
||||
using Library.Middleware;
|
||||
using Library.Repository;
|
||||
using Library.Responses;
|
||||
using Library.UrlMatcher;
|
||||
|
||||
public class DownstreamRouteFinderMiddlewareTests : IDisposable
|
||||
{
|
||||
private readonly Mock<IDownstreamRouteFinder> _downstreamRouteFinder;
|
@ -2,6 +2,8 @@
|
||||
using Moq;
|
||||
using Ocelot.Library.Configuration.Builder;
|
||||
using Ocelot.Library.Configuration.Provider;
|
||||
using Ocelot.Library.DownstreamRouteFinder.Finder;
|
||||
using Ocelot.Library.DownstreamRouteFinder.UrlMatcher;
|
||||
using Shouldly;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
@ -11,7 +13,6 @@ namespace Ocelot.UnitTests.DownstreamRouteFinder
|
||||
using Library.Configuration;
|
||||
using Library.DownstreamRouteFinder;
|
||||
using Library.Responses;
|
||||
using Library.UrlMatcher;
|
||||
|
||||
public class DownstreamRouteFinderTests
|
||||
{
|
||||
@ -30,7 +31,7 @@ namespace Ocelot.UnitTests.DownstreamRouteFinder
|
||||
_mockConfig = new Mock<IOcelotConfigurationProvider>();
|
||||
_mockMatcher = new Mock<IUrlPathToUrlTemplateMatcher>();
|
||||
_finder = new Mock<ITemplateVariableNameAndValueFinder>();
|
||||
_downstreamRouteFinder = new DownstreamRouteFinder(_mockConfig.Object, _mockMatcher.Object, _finder.Object);
|
||||
_downstreamRouteFinder = new Library.DownstreamRouteFinder.Finder.DownstreamRouteFinder(_mockConfig.Object, _mockMatcher.Object, _finder.Object);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -1,12 +1,11 @@
|
||||
using Ocelot.Library.DownstreamRouteFinder.UrlMatcher;
|
||||
using Ocelot.Library.Responses;
|
||||
using Shouldly;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
namespace Ocelot.UnitTests.UrlMatcher
|
||||
namespace Ocelot.UnitTests.DownstreamRouteFinder.UrlMatcher
|
||||
{
|
||||
using Library.Responses;
|
||||
using Library.UrlMatcher;
|
||||
|
||||
public class RegExUrlMatcherTests
|
||||
{
|
||||
private readonly IUrlPathToUrlTemplateMatcher _urlMatcher;
|
@ -1,14 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Ocelot.Library.DownstreamRouteFinder.UrlMatcher;
|
||||
using Ocelot.Library.Responses;
|
||||
using Shouldly;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
namespace Ocelot.UnitTests.UrlMatcher
|
||||
namespace Ocelot.UnitTests.DownstreamRouteFinder.UrlMatcher
|
||||
{
|
||||
using Library.Responses;
|
||||
using Library.UrlMatcher;
|
||||
|
||||
public class UrlPathToUrlTemplateMatcherTests
|
||||
{
|
||||
private readonly ITemplateVariableNameAndValueFinder _finder;
|
@ -1,24 +1,23 @@
|
||||
using Ocelot.Library.Configuration.Builder;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.TestHost;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Moq;
|
||||
using Ocelot.Library.Configuration.Builder;
|
||||
using Ocelot.Library.DownstreamRouteFinder;
|
||||
using Ocelot.Library.DownstreamRouteFinder.UrlMatcher;
|
||||
using Ocelot.Library.DownstreamUrlCreator.Middleware;
|
||||
using Ocelot.Library.DownstreamUrlCreator.UrlTemplateReplacer;
|
||||
using Ocelot.Library.Responses;
|
||||
using Ocelot.Library.ScopedData;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
namespace Ocelot.UnitTests.Middleware
|
||||
namespace Ocelot.UnitTests.DownstreamUrlCreator
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using Library.DownstreamRouteFinder;
|
||||
using Library.Middleware;
|
||||
using Library.Repository;
|
||||
using Library.Responses;
|
||||
using Library.UrlMatcher;
|
||||
using Library.UrlTemplateReplacer;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.TestHost;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Moq;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
public class DownstreamUrlCreatorMiddlewareTests : IDisposable
|
||||
{
|
||||
private readonly Mock<IDownstreamUrlTemplateVariableReplacer> _downstreamUrlTemplateVariableReplacer;
|
@ -1,16 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using Ocelot.Library.Configuration.Builder;
|
||||
using Ocelot.Library.DownstreamRouteFinder;
|
||||
using Ocelot.Library.DownstreamRouteFinder.UrlMatcher;
|
||||
using Ocelot.Library.DownstreamUrlCreator.UrlTemplateReplacer;
|
||||
using Ocelot.Library.Responses;
|
||||
using Shouldly;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
namespace Ocelot.UnitTests.UrlTemplateReplacer
|
||||
namespace Ocelot.UnitTests.DownstreamUrlCreator.UrlTemplateReplacer
|
||||
{
|
||||
using Library.DownstreamRouteFinder;
|
||||
using Library.Responses;
|
||||
using Library.UrlMatcher;
|
||||
using Library.UrlTemplateReplacer;
|
||||
|
||||
public class UpstreamUrlPathTemplateVariableReplacerTests
|
||||
{
|
||||
private DownstreamRoute _downstreamRoute;
|
@ -6,13 +6,14 @@ using Microsoft.Extensions.Primitives;
|
||||
using Moq;
|
||||
using Ocelot.Library.Configuration;
|
||||
using Ocelot.Library.Errors;
|
||||
using Ocelot.Library.RequestBuilder;
|
||||
using Ocelot.Library.HeaderBuilder;
|
||||
using Ocelot.Library.HeaderBuilder.Parser;
|
||||
using Ocelot.Library.Responses;
|
||||
using Shouldly;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
namespace Ocelot.UnitTests.RequestBuilder
|
||||
namespace Ocelot.UnitTests.HeaderBuilder
|
||||
{
|
||||
public class AddHeadersToRequestTests
|
||||
{
|
@ -1,13 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Claims;
|
||||
using Ocelot.Library.Errors;
|
||||
using Ocelot.Library.RequestBuilder;
|
||||
using Ocelot.Library.HeaderBuilder.Parser;
|
||||
using Ocelot.Library.Responses;
|
||||
using Shouldly;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
namespace Ocelot.UnitTests.RequestBuilder
|
||||
namespace Ocelot.UnitTests.HeaderBuilder
|
||||
{
|
||||
public class ClaimParserTests
|
||||
{
|
||||
@ -21,7 +21,7 @@ namespace Ocelot.UnitTests.RequestBuilder
|
||||
public ClaimParserTests()
|
||||
{
|
||||
_claims = new List<Claim>();
|
||||
_claimsParser = new Library.RequestBuilder.ClaimsParser();
|
||||
_claimsParser = new ClaimsParser();
|
||||
}
|
||||
|
||||
[Fact]
|
@ -10,15 +10,15 @@ using Moq;
|
||||
using Ocelot.Library.Configuration;
|
||||
using Ocelot.Library.Configuration.Builder;
|
||||
using Ocelot.Library.DownstreamRouteFinder;
|
||||
using Ocelot.Library.Middleware;
|
||||
using Ocelot.Library.Repository;
|
||||
using Ocelot.Library.RequestBuilder;
|
||||
using Ocelot.Library.DownstreamRouteFinder.UrlMatcher;
|
||||
using Ocelot.Library.HeaderBuilder;
|
||||
using Ocelot.Library.HeaderBuilder.Middleware;
|
||||
using Ocelot.Library.Responses;
|
||||
using Ocelot.Library.UrlMatcher;
|
||||
using Ocelot.Library.ScopedData;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
namespace Ocelot.UnitTests.Middleware
|
||||
namespace Ocelot.UnitTests.HeaderBuilder
|
||||
{
|
||||
public class HttpRequestHeadersBuilderMiddlewareTests : IDisposable
|
||||
{
|
@ -1,11 +1,11 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Ocelot.Library.ScopedData;
|
||||
using Shouldly;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
namespace Ocelot.UnitTests.Repository
|
||||
{
|
||||
using Library.Repository;
|
||||
using Library.Responses;
|
||||
|
||||
public class ScopedRequestDataRepositoryTests
|
||||
|
@ -7,16 +7,16 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.TestHost;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Moq;
|
||||
using Ocelot.Library.RequestBuilder;
|
||||
using Ocelot.Library.RequestBuilder.Builder;
|
||||
using Ocelot.Library.RequestBuilder.Middleware;
|
||||
using Ocelot.Library.Responses;
|
||||
using Ocelot.Library.ScopedData;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
namespace Ocelot.UnitTests.Middleware
|
||||
namespace Ocelot.UnitTests.RequestBuilder
|
||||
{
|
||||
using Library.Middleware;
|
||||
using Library.Repository;
|
||||
using Library.RequestBuilder;
|
||||
using Library.Responses;
|
||||
|
||||
public class HttpRequestBuilderMiddlewareTests : IDisposable
|
||||
{
|
||||
private readonly Mock<IRequestBuilder> _requestBuilder;
|
@ -5,6 +5,7 @@ using System.Net;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http.Internal;
|
||||
using Ocelot.Library.RequestBuilder.Builder;
|
||||
using Shouldly;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
@ -6,17 +6,16 @@ using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.TestHost;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Moq;
|
||||
using Ocelot.Library.RequestBuilder;
|
||||
using Ocelot.Library.Requester;
|
||||
using Ocelot.Library.Requester.Middleware;
|
||||
using Ocelot.Library.Responses;
|
||||
using Ocelot.Library.ScopedData;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
namespace Ocelot.UnitTests.Middleware
|
||||
namespace Ocelot.UnitTests.Requester
|
||||
{
|
||||
using Library.Middleware;
|
||||
using Library.Repository;
|
||||
using Library.RequestBuilder;
|
||||
using Library.Requester;
|
||||
using Library.Responses;
|
||||
|
||||
public class HttpRequesterMiddlewareTests : IDisposable
|
||||
{
|
||||
private readonly Mock<IHttpRequester> _requester;
|
@ -6,16 +6,15 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.TestHost;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Moq;
|
||||
using Ocelot.Library.Responder;
|
||||
using Ocelot.Library.Responder.Middleware;
|
||||
using Ocelot.Library.Responses;
|
||||
using Ocelot.Library.ScopedData;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
namespace Ocelot.UnitTests.Middleware
|
||||
namespace Ocelot.UnitTests.Responder
|
||||
{
|
||||
using Library.Middleware;
|
||||
using Library.Repository;
|
||||
using Library.Responder;
|
||||
using Library.Responses;
|
||||
|
||||
public class HttpResponderMiddlewareTests : IDisposable
|
||||
{
|
||||
private readonly Mock<IHttpResponder> _responder;
|
Reference in New Issue
Block a user