Fix file names to match class names

SA1649
This commit is contained in:
Philip Wood 2018-03-03 13:48:30 +00:00
parent c7dbfc044f
commit a64e263a26
13 changed files with 102 additions and 92 deletions

View File

@ -1,14 +1,14 @@
namespace Ocelot.Configuration
{
public class ServiceProviderConfiguration
{
public ServiceProviderConfiguration(string serviceProviderHost, int serviceProviderPort)
{
ServiceProviderHost = serviceProviderHost;
ServiceProviderPort = serviceProviderPort;
}
public string ServiceProviderHost { get; private set; }
public int ServiceProviderPort { get; private set; }
}
namespace Ocelot.Configuration
{
public class ServiceProviderConfiguration
{
public ServiceProviderConfiguration(string serviceProviderHost, int serviceProviderPort)
{
ServiceProviderHost = serviceProviderHost;
ServiceProviderPort = serviceProviderPort;
}
public string ServiceProviderHost { get; private set; }
public int ServiceProviderPort { get; private set; }
}
}

View File

@ -1,10 +1,10 @@
using System.Collections.Generic;
using Ocelot.Responses;
namespace Ocelot.DownstreamRouteFinder.UrlMatcher
{
public interface IPlaceholderNameAndValueFinder
{
Response<List<PlaceholderNameAndValue>> Find(string path, string pathTemplate);
}
}
using System.Collections.Generic;
using Ocelot.Responses;
namespace Ocelot.DownstreamRouteFinder.UrlMatcher
{
public interface IPlaceholderNameAndValueFinder
{
Response<List<PlaceholderNameAndValue>> Find(string path, string pathTemplate);
}
}

View File

@ -1,14 +1,14 @@
namespace Ocelot.DownstreamRouteFinder.UrlMatcher
{
public class PlaceholderNameAndValue
{
public PlaceholderNameAndValue(string name, string value)
{
Name = name;
Value = value;
}
public string Name {get;private set;}
public string Value {get;private set;}
}
}
namespace Ocelot.DownstreamRouteFinder.UrlMatcher
{
public class PlaceholderNameAndValue
{
public PlaceholderNameAndValue(string name, string value)
{
Name = name;
Value = value;
}
public string Name {get;private set;}
public string Value {get;private set;}
}
}

View File

@ -1,25 +1,25 @@
using System.Collections.Generic;
using System.Text;
using Ocelot.DownstreamRouteFinder.UrlMatcher;
using Ocelot.Responses;
using Ocelot.Values;
namespace Ocelot.DownstreamUrlCreator.UrlTemplateReplacer
{
public class DownstreamTemplatePathPlaceholderReplacer : IDownstreamPathPlaceholderReplacer
{
public Response<DownstreamPath> Replace(PathTemplate downstreamPathTemplate, List<PlaceholderNameAndValue> urlPathPlaceholderNameAndValues)
{
var downstreamPath = new StringBuilder();
downstreamPath.Append(downstreamPathTemplate.Value);
foreach (var placeholderVariableAndValue in urlPathPlaceholderNameAndValues)
{
downstreamPath.Replace(placeholderVariableAndValue.Name, placeholderVariableAndValue.Value);
}
return new OkResponse<DownstreamPath>(new DownstreamPath(downstreamPath.ToString()));
}
}
using System.Collections.Generic;
using System.Text;
using Ocelot.DownstreamRouteFinder.UrlMatcher;
using Ocelot.Responses;
using Ocelot.Values;
namespace Ocelot.DownstreamUrlCreator.UrlTemplateReplacer
{
public class DownstreamTemplatePathPlaceholderReplacer : IDownstreamPathPlaceholderReplacer
{
public Response<DownstreamPath> Replace(PathTemplate downstreamPathTemplate, List<PlaceholderNameAndValue> urlPathPlaceholderNameAndValues)
{
var downstreamPath = new StringBuilder();
downstreamPath.Append(downstreamPathTemplate.Value);
foreach (var placeholderVariableAndValue in urlPathPlaceholderNameAndValues)
{
downstreamPath.Replace(placeholderVariableAndValue.Name, placeholderVariableAndValue.Value);
}
return new OkResponse<DownstreamPath>(new DownstreamPath(downstreamPath.ToString()));
}
}
}

View File

@ -1,12 +1,12 @@
using System.Collections.Generic;
using Ocelot.DownstreamRouteFinder.UrlMatcher;
using Ocelot.Responses;
using Ocelot.Values;
namespace Ocelot.DownstreamUrlCreator.UrlTemplateReplacer
{
public interface IDownstreamPathPlaceholderReplacer
{
Response<DownstreamPath> Replace(PathTemplate downstreamPathTemplate, List<PlaceholderNameAndValue> urlPathPlaceholderNameAndValues);
}
using System.Collections.Generic;
using Ocelot.DownstreamRouteFinder.UrlMatcher;
using Ocelot.Responses;
using Ocelot.Values;
namespace Ocelot.DownstreamUrlCreator.UrlTemplateReplacer
{
public interface IDownstreamPathPlaceholderReplacer
{
Response<DownstreamPath> Replace(PathTemplate downstreamPathTemplate, List<PlaceholderNameAndValue> urlPathPlaceholderNameAndValues);
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace Ocelot.Raft
{
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Property)]
public class ExcludeFromCoverageAttribute : Attribute{}
using System;
namespace Ocelot.Raft
{
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Property)]
public class ExcludeFromCoverageAttribute : Attribute{}
}

View File

@ -0,0 +1,6 @@
namespace Ocelot.Requester
{
public interface ITracingHandler
{
}
}

View File

@ -8,10 +8,6 @@ using Butterfly.OpenTracing;
namespace Ocelot.Requester
{
public interface ITracingHandler
{
}
public class OcelotHttpTracingHandler : DelegatingHandler, ITracingHandler
{
private readonly IServiceTracer _tracer;

View File

@ -3,7 +3,9 @@ using Ocelot.Errors;
namespace Ocelot.Responses
{
#pragma warning disable SA1649 // File name must match first type name
public class ErrorResponse<T> : Response<T>
#pragma warning restore SA1649 // File name must match first type name
{
public ErrorResponse(Error error)
: base(new List<Error> {error})

View File

@ -1,9 +1,11 @@
namespace Ocelot.Responses
{
#pragma warning disable SA1649 // File name must match first type name
public class OkResponse<T> : Response<T>
#pragma warning restore SA1649 // File name must match first type name
{
public OkResponse(T data) : base(data)
{
}
}
}
}

View File

@ -3,7 +3,9 @@ using Ocelot.Errors;
namespace Ocelot.Responses
{
#pragma warning disable SA1649 // File name must match first type name
public abstract class Response<T> : Response
#pragma warning restore SA1649 // File name must match first type name
{
protected Response(T data)
{

View File

@ -0,0 +1,10 @@
namespace Ocelot.UnitTests
{
public class Wait
{
public static Waiter WaitFor(int milliSeconds)
{
return new Waiter(milliSeconds);
}
}
}

View File

@ -3,14 +3,6 @@ using System.Diagnostics;
namespace Ocelot.UnitTests
{
public class Wait
{
public static Waiter WaitFor(int milliSeconds)
{
return new Waiter(milliSeconds);
}
}
public class Waiter
{
private readonly int _milliSeconds;
@ -52,4 +44,4 @@ namespace Ocelot.UnitTests
return passed;
}
}
}
}