reorganised project so its a bit more vertical for features

This commit is contained in:
TomPallister 2016-10-18 18:52:43 +01:00
parent 2e6640c6ef
commit f79b76b414
77 changed files with 324 additions and 298 deletions

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.Authentication using Microsoft.AspNetCore.Http;
{
using Microsoft.AspNetCore.Http;
namespace Ocelot.Library.Authentication.Handler
{
public class AuthenticationHandler public class AuthenticationHandler
{ {
public AuthenticationHandler(string provider, RequestDelegate handler) public AuthenticationHandler(string provider, RequestDelegate handler)

View File

@ -1,9 +1,10 @@
namespace Ocelot.Library.Authentication using IdentityServer4.AccessTokenValidation;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Ocelot.Library.Responses;
namespace Ocelot.Library.Authentication.Handler.Creator
{ {
using IdentityServer4.AccessTokenValidation;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Responses;
using AuthenticationOptions = Configuration.AuthenticationOptions; using AuthenticationOptions = Configuration.AuthenticationOptions;
/// <summary> /// <summary>

View File

@ -1,8 +1,9 @@
namespace Ocelot.Library.Authentication using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Ocelot.Library.Responses;
namespace Ocelot.Library.Authentication.Handler.Creator
{ {
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Responses;
using AuthenticationOptions = Configuration.AuthenticationOptions; using AuthenticationOptions = Configuration.AuthenticationOptions;
public interface IAuthenticationHandlerCreator public interface IAuthenticationHandlerCreator

View File

@ -1,9 +1,11 @@
namespace Ocelot.Library.Authentication using System.Collections.Generic;
using Microsoft.AspNetCore.Builder;
using Ocelot.Library.Authentication.Handler.Creator;
using Ocelot.Library.Errors;
using Ocelot.Library.Responses;
namespace Ocelot.Library.Authentication.Handler.Factory
{ {
using System.Collections.Generic;
using Errors;
using Microsoft.AspNetCore.Builder;
using Responses;
using AuthenticationOptions = Configuration.AuthenticationOptions; using AuthenticationOptions = Configuration.AuthenticationOptions;
public class AuthenticationHandlerFactory : IAuthenticationHandlerFactory public class AuthenticationHandlerFactory : IAuthenticationHandlerFactory

View File

@ -1,7 +1,8 @@
namespace Ocelot.Library.Authentication using Microsoft.AspNetCore.Builder;
using Ocelot.Library.Responses;
namespace Ocelot.Library.Authentication.Handler.Factory
{ {
using Microsoft.AspNetCore.Builder;
using Responses;
using AuthenticationOptions = Configuration.AuthenticationOptions; using AuthenticationOptions = Configuration.AuthenticationOptions;
public interface IAuthenticationHandlerFactory public interface IAuthenticationHandlerFactory

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.Authentication using Ocelot.Library.Errors;
{
using Errors;
namespace Ocelot.Library.Authentication.Handler.Factory
{
public class UnableToCreateAuthenticationHandlerError : Error public class UnableToCreateAuthenticationHandlerError : Error
{ {
public UnableToCreateAuthenticationHandlerError(string message) public UnableToCreateAuthenticationHandlerError(string message)

View File

@ -0,0 +1,7 @@
namespace Ocelot.Library.Authentication.Handler
{
public enum SupportedAuthenticationProviders
{
IdentityServer
}
}

View File

@ -1,15 +1,16 @@
namespace Ocelot.Library.Middleware using System.Collections.Generic;
{ using System.Threading.Tasks;
using System.Collections.Generic; using Microsoft.AspNetCore.Builder;
using System.Threading.Tasks; using Microsoft.AspNetCore.Http;
using Authentication; using Ocelot.Library.Authentication.Handler.Factory;
using Configuration; using Ocelot.Library.Configuration;
using DownstreamRouteFinder; using Ocelot.Library.DownstreamRouteFinder;
using Errors; using Ocelot.Library.Errors;
using Microsoft.AspNetCore.Builder; using Ocelot.Library.Middleware;
using Microsoft.AspNetCore.Http; using Ocelot.Library.ScopedData;
using Repository;
namespace Ocelot.Library.Authentication.Middleware
{
public class AuthenticationMiddleware : OcelotMiddleware public class AuthenticationMiddleware : OcelotMiddleware
{ {
private readonly RequestDelegate _next; private readonly RequestDelegate _next;

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.Middleware using Microsoft.AspNetCore.Builder;
{
using Microsoft.AspNetCore.Builder;
namespace Ocelot.Library.Authentication.Middleware
{
public static class AuthenticationMiddlewareMiddlewareExtensions public static class AuthenticationMiddlewareMiddlewareExtensions
{ {
public static IApplicationBuilder UseAuthenticationMiddleware(this IApplicationBuilder builder) public static IApplicationBuilder UseAuthenticationMiddleware(this IApplicationBuilder builder)

View File

@ -1,7 +0,0 @@
namespace Ocelot.Library.Authentication
{
public enum SupportAuthenticationProviders
{
IdentityServer
}
}

View File

@ -2,13 +2,12 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Ocelot.Library.Configuration.Creator;
using Ocelot.Library.Configuration.Parser; using Ocelot.Library.Configuration.Parser;
using Ocelot.Library.Configuration.Repository; using Ocelot.Library.Configuration.Validator;
using Ocelot.Library.Errors; using Ocelot.Library.Configuration.Yaml;
using Ocelot.Library.Responses; using Ocelot.Library.Responses;
namespace Ocelot.Library.Configuration.Yaml namespace Ocelot.Library.Configuration.Creator
{ {
/// <summary> /// <summary>
/// Register as singleton /// Register as singleton

View File

@ -1,6 +1,6 @@
using Ocelot.Library.Errors; using Ocelot.Library.Errors;
namespace Ocelot.Library.RequestBuilder namespace Ocelot.Library.Configuration.Parser
{ {
public class InstructionNotForClaimsError : Error public class InstructionNotForClaimsError : Error
{ {

View File

@ -1,6 +1,6 @@
using Ocelot.Library.Errors; using Ocelot.Library.Errors;
namespace Ocelot.Library.RequestBuilder namespace Ocelot.Library.Configuration.Parser
{ {
public class NoInstructionsError : Error public class NoInstructionsError : Error
{ {

View File

@ -1,7 +1,7 @@
using System; using System;
using Ocelot.Library.Errors; using Ocelot.Library.Errors;
namespace Ocelot.Library.RequestBuilder namespace Ocelot.Library.Configuration.Parser
{ {
public class ParsingConfigurationHeaderError : Error public class ParsingConfigurationHeaderError : Error
{ {

View File

@ -1,9 +1,8 @@
using Ocelot.Library.Configuration.Creator; using Ocelot.Library.Configuration.Creator;
using Ocelot.Library.Configuration.Provider;
using Ocelot.Library.Configuration.Repository; using Ocelot.Library.Configuration.Repository;
using Ocelot.Library.Responses; using Ocelot.Library.Responses;
namespace Ocelot.Library.Configuration.Yaml namespace Ocelot.Library.Configuration.Provider
{ {
/// <summary> /// <summary>
/// Register as singleton /// Register as singleton

View File

@ -1,8 +1,8 @@
namespace Ocelot.Library.Configuration.Yaml using System.Collections.Generic;
{ using Ocelot.Library.Errors;
using System.Collections.Generic;
using Errors;
namespace Ocelot.Library.Configuration.Validator
{
public class ConfigurationValidationResult public class ConfigurationValidationResult
{ {
public ConfigurationValidationResult(bool isError) public ConfigurationValidationResult(bool isError)

View File

@ -1,12 +1,14 @@
namespace Ocelot.Library.Configuration.Yaml using System;
{ using System.Collections.Generic;
using System; using System.Linq;
using System.Collections.Generic; using Ocelot.Library.Authentication;
using System.Linq; using Ocelot.Library.Authentication.Handler;
using Authentication; using Ocelot.Library.Configuration.Yaml;
using Errors; using Ocelot.Library.Errors;
using Responses; using Ocelot.Library.Responses;
namespace Ocelot.Library.Configuration.Validator
{
public class ConfigurationValidator : IConfigurationValidator public class ConfigurationValidator : IConfigurationValidator
{ {
public Response<ConfigurationValidationResult> IsValid(YamlConfiguration configuration) public Response<ConfigurationValidationResult> IsValid(YamlConfiguration configuration)
@ -57,7 +59,7 @@
private bool IsSupportedAuthenticationProvider(string provider) private bool IsSupportedAuthenticationProvider(string provider)
{ {
SupportAuthenticationProviders supportedProvider; SupportedAuthenticationProviders supportedProvider;
return Enum.TryParse(provider, true, out supportedProvider); return Enum.TryParse(provider, true, out supportedProvider);
} }

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.Configuration.Yaml using Ocelot.Library.Errors;
{
using Errors;
namespace Ocelot.Library.Configuration.Validator
{
public class DownstreamTemplateAlreadyUsedError : Error public class DownstreamTemplateAlreadyUsedError : Error
{ {
public DownstreamTemplateAlreadyUsedError(string message) : base(message, OcelotErrorCode.DownstreamTemplateAlreadyUsedError) public DownstreamTemplateAlreadyUsedError(string message) : base(message, OcelotErrorCode.DownstreamTemplateAlreadyUsedError)

View File

@ -1,7 +1,8 @@
namespace Ocelot.Library.Configuration.Yaml using Ocelot.Library.Configuration.Yaml;
{ using Ocelot.Library.Responses;
using Responses;
namespace Ocelot.Library.Configuration.Validator
{
public interface IConfigurationValidator public interface IConfigurationValidator
{ {
Response<ConfigurationValidationResult> IsValid(YamlConfiguration configuration); Response<ConfigurationValidationResult> IsValid(YamlConfiguration configuration);

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.Configuration.Yaml using Ocelot.Library.Errors;
{
using Errors;
namespace Ocelot.Library.Configuration.Validator
{
public class UnsupportedAuthenticationProviderError : Error public class UnsupportedAuthenticationProviderError : Error
{ {
public UnsupportedAuthenticationProviderError(string message) public UnsupportedAuthenticationProviderError(string message)

View File

@ -1,7 +1,17 @@
using Ocelot.Library.Configuration.Creator; using Ocelot.Library.Authentication.Handler.Creator;
using Ocelot.Library.Authentication.Handler.Factory;
using Ocelot.Library.Configuration.Creator;
using Ocelot.Library.Configuration.Parser; using Ocelot.Library.Configuration.Parser;
using Ocelot.Library.Configuration.Provider; using Ocelot.Library.Configuration.Provider;
using Ocelot.Library.Configuration.Repository; using Ocelot.Library.Configuration.Repository;
using Ocelot.Library.Configuration.Validator;
using Ocelot.Library.DownstreamRouteFinder.Finder;
using Ocelot.Library.DownstreamRouteFinder.UrlMatcher;
using Ocelot.Library.DownstreamUrlCreator.UrlTemplateReplacer;
using Ocelot.Library.HeaderBuilder;
using Ocelot.Library.HeaderBuilder.Parser;
using Ocelot.Library.RequestBuilder.Builder;
using Ocelot.Library.ScopedData;
namespace Ocelot.Library.DependencyInjection namespace Ocelot.Library.DependencyInjection
{ {
@ -12,12 +22,9 @@ namespace Ocelot.Library.DependencyInjection
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Repository;
using RequestBuilder; using RequestBuilder;
using Requester; using Requester;
using Responder; using Responder;
using UrlMatcher;
using UrlTemplateReplacer;
public static class ServiceCollectionExtensions public static class ServiceCollectionExtensions
{ {
@ -48,7 +55,7 @@ namespace Ocelot.Library.DependencyInjection
services.AddSingleton<IUrlPathToUrlTemplateMatcher, RegExUrlMatcher>(); services.AddSingleton<IUrlPathToUrlTemplateMatcher, RegExUrlMatcher>();
services.AddSingleton<ITemplateVariableNameAndValueFinder, TemplateVariableNameAndValueFinder>(); services.AddSingleton<ITemplateVariableNameAndValueFinder, TemplateVariableNameAndValueFinder>();
services.AddSingleton<IDownstreamUrlTemplateVariableReplacer, DownstreamUrlTemplateVariableReplacer>(); services.AddSingleton<IDownstreamUrlTemplateVariableReplacer, DownstreamUrlTemplateVariableReplacer>();
services.AddSingleton<IDownstreamRouteFinder, DownstreamRouteFinder>(); services.AddSingleton<IDownstreamRouteFinder, DownstreamRouteFinder.Finder.DownstreamRouteFinder>();
services.AddSingleton<IHttpRequester, HttpClientHttpRequester>(); services.AddSingleton<IHttpRequester, HttpClientHttpRequester>();
services.AddSingleton<IHttpResponder, HttpContextResponder>(); services.AddSingleton<IHttpResponder, HttpContextResponder>();
services.AddSingleton<IRequestBuilder, HttpRequestBuilder>(); services.AddSingleton<IRequestBuilder, HttpRequestBuilder>();

View File

@ -1,8 +1,9 @@
namespace Ocelot.Library.DownstreamRouteFinder using Ocelot.Library.DownstreamRouteFinder.UrlMatcher;
namespace Ocelot.Library.DownstreamRouteFinder
{ {
using System.Collections.Generic; using System.Collections.Generic;
using Configuration; using Configuration;
using UrlMatcher;
public class DownstreamRoute public class DownstreamRoute
{ {

View File

@ -2,11 +2,11 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Ocelot.Library.Configuration.Provider; using Ocelot.Library.Configuration.Provider;
using Ocelot.Library.DownstreamRouteFinder.UrlMatcher;
using Ocelot.Library.Errors; using Ocelot.Library.Errors;
using Ocelot.Library.Responses; using Ocelot.Library.Responses;
using Ocelot.Library.UrlMatcher;
namespace Ocelot.Library.DownstreamRouteFinder namespace Ocelot.Library.DownstreamRouteFinder.Finder
{ {
public class DownstreamRouteFinder : IDownstreamRouteFinder public class DownstreamRouteFinder : IDownstreamRouteFinder
{ {

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.DownstreamRouteFinder using Ocelot.Library.Responses;
{
using Responses;
namespace Ocelot.Library.DownstreamRouteFinder.Finder
{
public interface IDownstreamRouteFinder public interface IDownstreamRouteFinder
{ {
Response<DownstreamRoute> FindDownstreamRoute(string upstreamUrlPath, string upstreamHttpMethod); Response<DownstreamRoute> FindDownstreamRoute(string upstreamUrlPath, string upstreamHttpMethod);

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.DownstreamRouteFinder using Ocelot.Library.Errors;
{
using Errors;
namespace Ocelot.Library.DownstreamRouteFinder.Finder
{
public class UnableToFindDownstreamRouteError : Error public class UnableToFindDownstreamRouteError : Error
{ {
public UnableToFindDownstreamRouteError() : base("UnableToFindDownstreamRouteError", OcelotErrorCode.UnableToFindDownstreamRouteError) public UnableToFindDownstreamRouteError() : base("UnableToFindDownstreamRouteError", OcelotErrorCode.UnableToFindDownstreamRouteError)

View File

@ -1,10 +1,11 @@
namespace Ocelot.Library.Middleware using System.Threading.Tasks;
{ using Microsoft.AspNetCore.Http;
using System.Threading.Tasks; using Ocelot.Library.DownstreamRouteFinder.Finder;
using DownstreamRouteFinder; using Ocelot.Library.Middleware;
using Microsoft.AspNetCore.Http; using Ocelot.Library.ScopedData;
using Repository;
namespace Ocelot.Library.DownstreamRouteFinder.Middleware
{
public class DownstreamRouteFinderMiddleware : OcelotMiddleware public class DownstreamRouteFinderMiddleware : OcelotMiddleware
{ {
private readonly RequestDelegate _next; private readonly RequestDelegate _next;

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.Middleware using Microsoft.AspNetCore.Builder;
{
using Microsoft.AspNetCore.Builder;
namespace Ocelot.Library.DownstreamRouteFinder.Middleware
{
public static class DownstreamRouteFinderMiddlewareExtensions public static class DownstreamRouteFinderMiddlewareExtensions
{ {
public static IApplicationBuilder UseDownstreamRouteFinderMiddleware(this IApplicationBuilder builder) public static IApplicationBuilder UseDownstreamRouteFinderMiddleware(this IApplicationBuilder builder)

View File

@ -1,8 +1,8 @@
namespace Ocelot.Library.UrlMatcher using System.Collections.Generic;
{ using Ocelot.Library.Responses;
using System.Collections.Generic;
using Responses;
namespace Ocelot.Library.DownstreamRouteFinder.UrlMatcher
{
public interface ITemplateVariableNameAndValueFinder public interface ITemplateVariableNameAndValueFinder
{ {
Response<List<TemplateVariableNameAndValue>> Find(string upstreamUrlPath, string upstreamUrlPathTemplate); Response<List<TemplateVariableNameAndValue>> Find(string upstreamUrlPath, string upstreamUrlPathTemplate);

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.UrlMatcher using Ocelot.Library.Responses;
{
using Responses;
namespace Ocelot.Library.DownstreamRouteFinder.UrlMatcher
{
public interface IUrlPathToUrlTemplateMatcher public interface IUrlPathToUrlTemplateMatcher
{ {
Response<UrlMatch> Match(string upstreamUrlPath, string upstreamUrlPathTemplate); Response<UrlMatch> Match(string upstreamUrlPath, string upstreamUrlPathTemplate);

View File

@ -1,8 +1,8 @@
namespace Ocelot.Library.UrlMatcher using System.Text.RegularExpressions;
{ using Ocelot.Library.Responses;
using System.Text.RegularExpressions;
using Responses;
namespace Ocelot.Library.DownstreamRouteFinder.UrlMatcher
{
public class RegExUrlMatcher : IUrlPathToUrlTemplateMatcher public class RegExUrlMatcher : IUrlPathToUrlTemplateMatcher
{ {
public Response<UrlMatch> Match(string upstreamUrlPath, string upstreamUrlPathTemplate) public Response<UrlMatch> Match(string upstreamUrlPath, string upstreamUrlPathTemplate)

View File

@ -1,4 +1,4 @@
namespace Ocelot.Library.UrlMatcher namespace Ocelot.Library.DownstreamRouteFinder.UrlMatcher
{ {
public class TemplateVariableNameAndValue public class TemplateVariableNameAndValue
{ {

View File

@ -1,8 +1,8 @@
namespace Ocelot.Library.UrlMatcher using System.Collections.Generic;
{ using Ocelot.Library.Responses;
using System.Collections.Generic;
using Responses;
namespace Ocelot.Library.DownstreamRouteFinder.UrlMatcher
{
public class TemplateVariableNameAndValueFinder : ITemplateVariableNameAndValueFinder public class TemplateVariableNameAndValueFinder : ITemplateVariableNameAndValueFinder
{ {
public Response<List<TemplateVariableNameAndValue>> Find(string upstreamUrlPath, string upstreamUrlPathTemplate) public Response<List<TemplateVariableNameAndValue>> Find(string upstreamUrlPath, string upstreamUrlPathTemplate)

View File

@ -1,4 +1,4 @@
namespace Ocelot.Library.UrlMatcher namespace Ocelot.Library.DownstreamRouteFinder.UrlMatcher
{ {
public class UrlMatch public class UrlMatch
{ {

View File

@ -1,11 +1,12 @@
namespace Ocelot.Library.Middleware using System.Threading.Tasks;
{ using Microsoft.AspNetCore.Http;
using System.Threading.Tasks; using Ocelot.Library.DownstreamRouteFinder;
using DownstreamRouteFinder; using Ocelot.Library.DownstreamUrlCreator.UrlTemplateReplacer;
using Microsoft.AspNetCore.Http; using Ocelot.Library.Middleware;
using Repository; using Ocelot.Library.ScopedData;
using UrlTemplateReplacer;
namespace Ocelot.Library.DownstreamUrlCreator.Middleware
{
public class DownstreamUrlCreatorMiddleware : OcelotMiddleware public class DownstreamUrlCreatorMiddleware : OcelotMiddleware
{ {
private readonly RequestDelegate _next; private readonly RequestDelegate _next;

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.Middleware using Microsoft.AspNetCore.Builder;
{
using Microsoft.AspNetCore.Builder;
namespace Ocelot.Library.DownstreamUrlCreator.Middleware
{
public static class DownstreamUrlCreatorMiddlewareExtensions public static class DownstreamUrlCreatorMiddlewareExtensions
{ {
public static IApplicationBuilder UseDownstreamUrlCreatorMiddleware(this IApplicationBuilder builder) public static IApplicationBuilder UseDownstreamUrlCreatorMiddleware(this IApplicationBuilder builder)

View File

@ -1,9 +1,9 @@
namespace Ocelot.Library.UrlTemplateReplacer using System.Text;
{ using Ocelot.Library.DownstreamRouteFinder;
using System.Text; using Ocelot.Library.Responses;
using DownstreamRouteFinder;
using Responses;
namespace Ocelot.Library.DownstreamUrlCreator.UrlTemplateReplacer
{
public class DownstreamUrlTemplateVariableReplacer : IDownstreamUrlTemplateVariableReplacer public class DownstreamUrlTemplateVariableReplacer : IDownstreamUrlTemplateVariableReplacer
{ {
public Response<string> ReplaceTemplateVariables(DownstreamRoute downstreamRoute) public Response<string> ReplaceTemplateVariables(DownstreamRoute downstreamRoute)

View File

@ -1,8 +1,8 @@
namespace Ocelot.Library.UrlTemplateReplacer using Ocelot.Library.DownstreamRouteFinder;
{ using Ocelot.Library.Responses;
using DownstreamRouteFinder;
using Responses;
namespace Ocelot.Library.DownstreamUrlCreator.UrlTemplateReplacer
{
public interface IDownstreamUrlTemplateVariableReplacer public interface IDownstreamUrlTemplateVariableReplacer
{ {
Response<string> ReplaceTemplateVariables(DownstreamRoute downstreamRoute); Response<string> ReplaceTemplateVariables(DownstreamRoute downstreamRoute);

View File

@ -3,9 +3,10 @@ using System.Linq;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
using Ocelot.Library.Configuration; using Ocelot.Library.Configuration;
using Ocelot.Library.HeaderBuilder.Parser;
using Ocelot.Library.Responses; using Ocelot.Library.Responses;
namespace Ocelot.Library.RequestBuilder namespace Ocelot.Library.HeaderBuilder
{ {
public class AddHeadersToRequest : IAddHeadersToRequest public class AddHeadersToRequest : IAddHeadersToRequest
{ {

View File

@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Http;
using Ocelot.Library.Configuration; using Ocelot.Library.Configuration;
using Ocelot.Library.Responses; using Ocelot.Library.Responses;
namespace Ocelot.Library.RequestBuilder namespace Ocelot.Library.HeaderBuilder
{ {
public interface IAddHeadersToRequest public interface IAddHeadersToRequest
{ {

View File

@ -1,15 +1,12 @@
using System.Collections.Generic; using System.Linq;
using System.Linq; using System.Threading.Tasks;
using Microsoft.Extensions.Primitives; using Microsoft.AspNetCore.Http;
using Ocelot.Library.DownstreamRouteFinder; using Ocelot.Library.DownstreamRouteFinder;
using Ocelot.Library.RequestBuilder; using Ocelot.Library.Middleware;
using Ocelot.Library.ScopedData;
namespace Ocelot.Library.Middleware namespace Ocelot.Library.HeaderBuilder.Middleware
{ {
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Repository;
public class HttpRequestHeadersBuilderMiddleware : OcelotMiddleware public class HttpRequestHeadersBuilderMiddleware : OcelotMiddleware
{ {
private readonly RequestDelegate _next; private readonly RequestDelegate _next;

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.Middleware using Microsoft.AspNetCore.Builder;
{
using Microsoft.AspNetCore.Builder;
namespace Ocelot.Library.HeaderBuilder.Middleware
{
public static class HttpRequestHeadersBuilderMiddlewareExtensions public static class HttpRequestHeadersBuilderMiddlewareExtensions
{ {
public static IApplicationBuilder UseHttpRequestHeadersBuilderMiddleware(this IApplicationBuilder builder) public static IApplicationBuilder UseHttpRequestHeadersBuilderMiddleware(this IApplicationBuilder builder)

View File

@ -1,6 +1,6 @@
using Ocelot.Library.Errors; using Ocelot.Library.Errors;
namespace Ocelot.Library.RequestBuilder namespace Ocelot.Library.HeaderBuilder.Parser
{ {
public class CannotFindClaimError : Error public class CannotFindClaimError : Error
{ {

View File

@ -4,7 +4,7 @@ using System.Security.Claims;
using Ocelot.Library.Errors; using Ocelot.Library.Errors;
using Ocelot.Library.Responses; using Ocelot.Library.Responses;
namespace Ocelot.Library.RequestBuilder namespace Ocelot.Library.HeaderBuilder.Parser
{ {
public class ClaimsParser : IClaimsParser public class ClaimsParser : IClaimsParser
{ {

View File

@ -2,7 +2,7 @@
using System.Security.Claims; using System.Security.Claims;
using Ocelot.Library.Responses; using Ocelot.Library.Responses;
namespace Ocelot.Library.RequestBuilder namespace Ocelot.Library.HeaderBuilder.Parser
{ {
public interface IClaimsParser public interface IClaimsParser
{ {

View File

@ -1,8 +1,9 @@
namespace Ocelot.Library.Middleware using Ocelot.Library.ScopedData;
namespace Ocelot.Library.Middleware
{ {
using System.Collections.Generic; using System.Collections.Generic;
using Errors; using Errors;
using Repository;
public abstract class OcelotMiddleware public abstract class OcelotMiddleware
{ {

View File

@ -1,4 +1,12 @@
namespace Ocelot.Library.Middleware using Ocelot.Library.Authentication.Middleware;
using Ocelot.Library.DownstreamRouteFinder.Middleware;
using Ocelot.Library.DownstreamUrlCreator.Middleware;
using Ocelot.Library.HeaderBuilder.Middleware;
using Ocelot.Library.RequestBuilder.Middleware;
using Ocelot.Library.Requester.Middleware;
using Ocelot.Library.Responder.Middleware;
namespace Ocelot.Library.Middleware
{ {
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;

View File

@ -1,14 +1,14 @@
namespace Ocelot.Library.RequestBuilder using System;
{ using System.IO;
using System; using System.Net;
using System.IO; using System.Net.Http;
using System.Net; using System.Net.Http.Headers;
using System.Net.Http; using System.Threading.Tasks;
using System.Net.Http.Headers; using Microsoft.AspNetCore.Http;
using System.Threading.Tasks; using Ocelot.Library.Responses;
using Microsoft.AspNetCore.Http;
using Responses;
namespace Ocelot.Library.RequestBuilder.Builder
{
public class HttpRequestBuilder : IRequestBuilder public class HttpRequestBuilder : IRequestBuilder
{ {
public async Task<Response<Request>> Build(string httpMethod, string downstreamUrl, Stream content, IHeaderDictionary headers, public async Task<Response<Request>> Build(string httpMethod, string downstreamUrl, Stream content, IHeaderDictionary headers,

View File

@ -1,10 +1,10 @@
namespace Ocelot.Library.RequestBuilder using System.IO;
{ using System.Threading.Tasks;
using System.IO; using Microsoft.AspNetCore.Http;
using System.Threading.Tasks; using Ocelot.Library.Responses;
using Microsoft.AspNetCore.Http;
using Responses;
namespace Ocelot.Library.RequestBuilder.Builder
{
public interface IRequestBuilder public interface IRequestBuilder
{ {
Task<Response<Request>> Build(string httpMethod, Task<Response<Request>> Build(string httpMethod,

View File

@ -1,10 +1,11 @@
namespace Ocelot.Library.Middleware using System.Threading.Tasks;
{ using Microsoft.AspNetCore.Http;
using System.Threading.Tasks; using Ocelot.Library.Middleware;
using Microsoft.AspNetCore.Http; using Ocelot.Library.RequestBuilder.Builder;
using Repository; using Ocelot.Library.ScopedData;
using RequestBuilder;
namespace Ocelot.Library.RequestBuilder.Middleware
{
public class HttpRequestBuilderMiddleware : OcelotMiddleware public class HttpRequestBuilderMiddleware : OcelotMiddleware
{ {
private readonly RequestDelegate _next; private readonly RequestDelegate _next;

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.Middleware using Microsoft.AspNetCore.Builder;
{
using Microsoft.AspNetCore.Builder;
namespace Ocelot.Library.RequestBuilder.Middleware
{
public static class HttpRequestBuilderMiddlewareExtensions public static class HttpRequestBuilderMiddlewareExtensions
{ {
public static IApplicationBuilder UseHttpRequestBuilderMiddleware(this IApplicationBuilder builder) public static IApplicationBuilder UseHttpRequestBuilderMiddleware(this IApplicationBuilder builder)

View File

@ -1,11 +1,11 @@
namespace Ocelot.Library.Middleware using System.Threading.Tasks;
{ using Microsoft.AspNetCore.Http;
using System.Threading.Tasks; using Ocelot.Library.Middleware;
using Microsoft.AspNetCore.Http; using Ocelot.Library.RequestBuilder;
using Repository; using Ocelot.Library.ScopedData;
using RequestBuilder;
using Requester;
namespace Ocelot.Library.Requester.Middleware
{
public class HttpRequesterMiddleware : OcelotMiddleware public class HttpRequesterMiddleware : OcelotMiddleware
{ {
private readonly RequestDelegate _next; private readonly RequestDelegate _next;

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.Middleware using Microsoft.AspNetCore.Builder;
{
using Microsoft.AspNetCore.Builder;
namespace Ocelot.Library.Requester.Middleware
{
public static class HttpRequesterMiddlewareExtensions public static class HttpRequesterMiddlewareExtensions
{ {
public static IApplicationBuilder UseHttpRequesterMiddleware(this IApplicationBuilder builder) public static IApplicationBuilder UseHttpRequesterMiddleware(this IApplicationBuilder builder)

View File

@ -1,11 +1,11 @@
namespace Ocelot.Library.Middleware using System.Net.Http;
{ using System.Threading.Tasks;
using System.Net.Http; using Microsoft.AspNetCore.Http;
using System.Threading.Tasks; using Ocelot.Library.Middleware;
using Microsoft.AspNetCore.Http; using Ocelot.Library.ScopedData;
using Repository;
using Responder;
namespace Ocelot.Library.Responder.Middleware
{
public class HttpResponderMiddleware : OcelotMiddleware public class HttpResponderMiddleware : OcelotMiddleware
{ {
private readonly RequestDelegate _next; private readonly RequestDelegate _next;

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.Middleware using Microsoft.AspNetCore.Builder;
{
using Microsoft.AspNetCore.Builder;
namespace Ocelot.Library.Responder.Middleware
{
public static class HttpResponderMiddlewareExtensions public static class HttpResponderMiddlewareExtensions
{ {
public static IApplicationBuilder UseHttpResponderMiddleware(this IApplicationBuilder builder) public static IApplicationBuilder UseHttpResponderMiddleware(this IApplicationBuilder builder)

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.Repository using Ocelot.Library.Errors;
{
using Errors;
namespace Ocelot.Library.ScopedData
{
public class CannotAddDataError : Error public class CannotAddDataError : Error
{ {
public CannotAddDataError(string message) : base(message, OcelotErrorCode.CannotAddDataError) public CannotAddDataError(string message) : base(message, OcelotErrorCode.CannotAddDataError)

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.Repository using Ocelot.Library.Errors;
{
using Errors;
namespace Ocelot.Library.ScopedData
{
public class CannotFindDataError : Error public class CannotFindDataError : Error
{ {
public CannotFindDataError(string message) : base(message, OcelotErrorCode.CannotFindDataError) public CannotFindDataError(string message) : base(message, OcelotErrorCode.CannotFindDataError)

View File

@ -1,7 +1,7 @@
namespace Ocelot.Library.Repository using Ocelot.Library.Responses;
{
using Responses;
namespace Ocelot.Library.ScopedData
{
public interface IScopedRequestDataRepository public interface IScopedRequestDataRepository
{ {
Response Add<T>(string key, T value); Response Add<T>(string key, T value);

View File

@ -1,11 +1,11 @@
namespace Ocelot.Library.Repository using System;
{ using System.Collections.Generic;
using System; using Microsoft.AspNetCore.Http;
using System.Collections.Generic; using Ocelot.Library.Errors;
using Errors; using Ocelot.Library.Responses;
using Microsoft.AspNetCore.Http;
using Responses;
namespace Ocelot.Library.ScopedData
{
public class ScopedRequestDataRepository : IScopedRequestDataRepository public class ScopedRequestDataRepository : IScopedRequestDataRepository
{ {
private readonly IHttpContextAccessor _httpContextAccessor; private readonly IHttpContextAccessor _httpContextAccessor;

View File

@ -3,6 +3,9 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Moq; using Moq;
using Ocelot.Library.Authentication.Handler;
using Ocelot.Library.Authentication.Handler.Creator;
using Ocelot.Library.Authentication.Handler.Factory;
using Shouldly; using Shouldly;
using TestStack.BDDfy; using TestStack.BDDfy;
using Xunit; using Xunit;

View File

@ -6,19 +6,18 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost; using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Moq; using Moq;
using Ocelot.Library.Authentication.Handler.Factory;
using Ocelot.Library.Authentication.Middleware;
using Ocelot.Library.Configuration.Builder; 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 TestStack.BDDfy;
using Xunit; 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 public class AuthenticationMiddlewareTests : IDisposable
{ {
private readonly Mock<IScopedRequestDataRepository> _scopedRepository; private readonly Mock<IScopedRequestDataRepository> _scopedRepository;

View File

@ -3,13 +3,12 @@ using System.Linq;
using Ocelot.Library.Configuration; using Ocelot.Library.Configuration;
using Ocelot.Library.Configuration.Parser; using Ocelot.Library.Configuration.Parser;
using Ocelot.Library.Errors; using Ocelot.Library.Errors;
using Ocelot.Library.RequestBuilder;
using Ocelot.Library.Responses; using Ocelot.Library.Responses;
using Shouldly; using Shouldly;
using TestStack.BDDfy; using TestStack.BDDfy;
using Xunit; using Xunit;
namespace Ocelot.UnitTests.RequestBuilder namespace Ocelot.UnitTests.Configuration
{ {
public class ConfigurationHeadersExtractorTests public class ConfigurationHeadersExtractorTests
{ {

View File

@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using Ocelot.Library.Configuration.Validator;
using Shouldly; using Shouldly;
using TestStack.BDDfy; using TestStack.BDDfy;
using Xunit; using Xunit;

View File

@ -3,8 +3,10 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Moq; using Moq;
using Ocelot.Library.Configuration.Builder; using Ocelot.Library.Configuration.Builder;
using Ocelot.Library.Configuration.Creator;
using Ocelot.Library.Configuration.Parser; using Ocelot.Library.Configuration.Parser;
using Ocelot.Library.Configuration.Repository; using Ocelot.Library.Configuration.Repository;
using Ocelot.Library.Configuration.Validator;
using Ocelot.Library.RequestBuilder; using Ocelot.Library.RequestBuilder;
using Shouldly; using Shouldly;
using TestStack.BDDfy; using TestStack.BDDfy;

View File

@ -7,17 +7,17 @@ using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Moq; using Moq;
using Ocelot.Library.Configuration.Builder; 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 TestStack.BDDfy;
using Xunit; 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 public class DownstreamRouteFinderMiddlewareTests : IDisposable
{ {
private readonly Mock<IDownstreamRouteFinder> _downstreamRouteFinder; private readonly Mock<IDownstreamRouteFinder> _downstreamRouteFinder;

View File

@ -2,6 +2,8 @@
using Moq; using Moq;
using Ocelot.Library.Configuration.Builder; using Ocelot.Library.Configuration.Builder;
using Ocelot.Library.Configuration.Provider; using Ocelot.Library.Configuration.Provider;
using Ocelot.Library.DownstreamRouteFinder.Finder;
using Ocelot.Library.DownstreamRouteFinder.UrlMatcher;
using Shouldly; using Shouldly;
using TestStack.BDDfy; using TestStack.BDDfy;
using Xunit; using Xunit;
@ -11,7 +13,6 @@ namespace Ocelot.UnitTests.DownstreamRouteFinder
using Library.Configuration; using Library.Configuration;
using Library.DownstreamRouteFinder; using Library.DownstreamRouteFinder;
using Library.Responses; using Library.Responses;
using Library.UrlMatcher;
public class DownstreamRouteFinderTests public class DownstreamRouteFinderTests
{ {
@ -30,7 +31,7 @@ namespace Ocelot.UnitTests.DownstreamRouteFinder
_mockConfig = new Mock<IOcelotConfigurationProvider>(); _mockConfig = new Mock<IOcelotConfigurationProvider>();
_mockMatcher = new Mock<IUrlPathToUrlTemplateMatcher>(); _mockMatcher = new Mock<IUrlPathToUrlTemplateMatcher>();
_finder = new Mock<ITemplateVariableNameAndValueFinder>(); _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] [Fact]

View File

@ -1,12 +1,11 @@
using Ocelot.Library.DownstreamRouteFinder.UrlMatcher;
using Ocelot.Library.Responses;
using Shouldly; using Shouldly;
using TestStack.BDDfy; using TestStack.BDDfy;
using Xunit; using Xunit;
namespace Ocelot.UnitTests.UrlMatcher namespace Ocelot.UnitTests.DownstreamRouteFinder.UrlMatcher
{ {
using Library.Responses;
using Library.UrlMatcher;
public class RegExUrlMatcherTests public class RegExUrlMatcherTests
{ {
private readonly IUrlPathToUrlTemplateMatcher _urlMatcher; private readonly IUrlPathToUrlTemplateMatcher _urlMatcher;

View File

@ -1,14 +1,13 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Ocelot.Library.DownstreamRouteFinder.UrlMatcher;
using Ocelot.Library.Responses;
using Shouldly; using Shouldly;
using TestStack.BDDfy; using TestStack.BDDfy;
using Xunit; using Xunit;
namespace Ocelot.UnitTests.UrlMatcher namespace Ocelot.UnitTests.DownstreamRouteFinder.UrlMatcher
{ {
using Library.Responses;
using Library.UrlMatcher;
public class UrlPathToUrlTemplateMatcherTests public class UrlPathToUrlTemplateMatcherTests
{ {
private readonly ITemplateVariableNameAndValueFinder _finder; private readonly ITemplateVariableNameAndValueFinder _finder;

View File

@ -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 public class DownstreamUrlCreatorMiddlewareTests : IDisposable
{ {
private readonly Mock<IDownstreamUrlTemplateVariableReplacer> _downstreamUrlTemplateVariableReplacer; private readonly Mock<IDownstreamUrlTemplateVariableReplacer> _downstreamUrlTemplateVariableReplacer;

View File

@ -1,16 +1,15 @@
using System.Collections.Generic; using System.Collections.Generic;
using Ocelot.Library.Configuration.Builder; 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 Shouldly;
using TestStack.BDDfy; using TestStack.BDDfy;
using Xunit; 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 public class UpstreamUrlPathTemplateVariableReplacerTests
{ {
private DownstreamRoute _downstreamRoute; private DownstreamRoute _downstreamRoute;

View File

@ -6,13 +6,14 @@ using Microsoft.Extensions.Primitives;
using Moq; using Moq;
using Ocelot.Library.Configuration; using Ocelot.Library.Configuration;
using Ocelot.Library.Errors; using Ocelot.Library.Errors;
using Ocelot.Library.RequestBuilder; using Ocelot.Library.HeaderBuilder;
using Ocelot.Library.HeaderBuilder.Parser;
using Ocelot.Library.Responses; using Ocelot.Library.Responses;
using Shouldly; using Shouldly;
using TestStack.BDDfy; using TestStack.BDDfy;
using Xunit; using Xunit;
namespace Ocelot.UnitTests.RequestBuilder namespace Ocelot.UnitTests.HeaderBuilder
{ {
public class AddHeadersToRequestTests public class AddHeadersToRequestTests
{ {

View File

@ -1,13 +1,13 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Security.Claims; using System.Security.Claims;
using Ocelot.Library.Errors; using Ocelot.Library.Errors;
using Ocelot.Library.RequestBuilder; using Ocelot.Library.HeaderBuilder.Parser;
using Ocelot.Library.Responses; using Ocelot.Library.Responses;
using Shouldly; using Shouldly;
using TestStack.BDDfy; using TestStack.BDDfy;
using Xunit; using Xunit;
namespace Ocelot.UnitTests.RequestBuilder namespace Ocelot.UnitTests.HeaderBuilder
{ {
public class ClaimParserTests public class ClaimParserTests
{ {
@ -21,7 +21,7 @@ namespace Ocelot.UnitTests.RequestBuilder
public ClaimParserTests() public ClaimParserTests()
{ {
_claims = new List<Claim>(); _claims = new List<Claim>();
_claimsParser = new Library.RequestBuilder.ClaimsParser(); _claimsParser = new ClaimsParser();
} }
[Fact] [Fact]

View File

@ -10,15 +10,15 @@ using Moq;
using Ocelot.Library.Configuration; using Ocelot.Library.Configuration;
using Ocelot.Library.Configuration.Builder; using Ocelot.Library.Configuration.Builder;
using Ocelot.Library.DownstreamRouteFinder; using Ocelot.Library.DownstreamRouteFinder;
using Ocelot.Library.Middleware; using Ocelot.Library.DownstreamRouteFinder.UrlMatcher;
using Ocelot.Library.Repository; using Ocelot.Library.HeaderBuilder;
using Ocelot.Library.RequestBuilder; using Ocelot.Library.HeaderBuilder.Middleware;
using Ocelot.Library.Responses; using Ocelot.Library.Responses;
using Ocelot.Library.UrlMatcher; using Ocelot.Library.ScopedData;
using TestStack.BDDfy; using TestStack.BDDfy;
using Xunit; using Xunit;
namespace Ocelot.UnitTests.Middleware namespace Ocelot.UnitTests.HeaderBuilder
{ {
public class HttpRequestHeadersBuilderMiddlewareTests : IDisposable public class HttpRequestHeadersBuilderMiddlewareTests : IDisposable
{ {

View File

@ -1,11 +1,11 @@
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Ocelot.Library.ScopedData;
using Shouldly; using Shouldly;
using TestStack.BDDfy; using TestStack.BDDfy;
using Xunit; using Xunit;
namespace Ocelot.UnitTests.Repository namespace Ocelot.UnitTests.Repository
{ {
using Library.Repository;
using Library.Responses; using Library.Responses;
public class ScopedRequestDataRepositoryTests public class ScopedRequestDataRepositoryTests

View File

@ -7,16 +7,16 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.TestHost; using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Moq; 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 TestStack.BDDfy;
using Xunit; 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 public class HttpRequestBuilderMiddlewareTests : IDisposable
{ {
private readonly Mock<IRequestBuilder> _requestBuilder; private readonly Mock<IRequestBuilder> _requestBuilder;

View File

@ -5,6 +5,7 @@ using System.Net;
using System.Net.Http; using System.Net.Http;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Internal; using Microsoft.AspNetCore.Http.Internal;
using Ocelot.Library.RequestBuilder.Builder;
using Shouldly; using Shouldly;
using TestStack.BDDfy; using TestStack.BDDfy;
using Xunit; using Xunit;

View File

@ -6,17 +6,16 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost; using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Moq; 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 TestStack.BDDfy;
using Xunit; 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 public class HttpRequesterMiddlewareTests : IDisposable
{ {
private readonly Mock<IHttpRequester> _requester; private readonly Mock<IHttpRequester> _requester;

View File

@ -6,16 +6,15 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.TestHost; using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Moq; using Moq;
using Ocelot.Library.Responder;
using Ocelot.Library.Responder.Middleware;
using Ocelot.Library.Responses;
using Ocelot.Library.ScopedData;
using TestStack.BDDfy; using TestStack.BDDfy;
using Xunit; 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 public class HttpResponderMiddlewareTests : IDisposable
{ {
private readonly Mock<IHttpResponder> _responder; private readonly Mock<IHttpResponder> _responder;