refactoring to consolidate configuration code

This commit is contained in:
Tom Pallister
2018-04-13 22:47:50 +01:00
parent f88e1f65ef
commit fe5662f954
32 changed files with 552 additions and 676 deletions

View File

@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Ocelot.Configuration;
using Ocelot.Configuration.Builder;
using Ocelot.Configuration.Repository;
@ -14,14 +12,14 @@ namespace Ocelot.UnitTests.Configuration
{
public class InMemoryConfigurationRepositoryTests
{
private readonly InMemoryOcelotConfigurationRepository _repo;
private IOcelotConfiguration _config;
private readonly InMemoryInternalConfigurationRepository _repo;
private IInternalConfiguration _config;
private Response _result;
private Response<IOcelotConfiguration> _getResult;
private Response<IInternalConfiguration> _getResult;
public InMemoryConfigurationRepositoryTests()
{
_repo = new InMemoryOcelotConfigurationRepository();
_repo = new InMemoryInternalConfigurationRepository();
}
[Fact]
@ -58,7 +56,7 @@ namespace Ocelot.UnitTests.Configuration
WhenIAddOrReplaceTheConfig();
}
private void GivenTheConfigurationIs(IOcelotConfiguration config)
private void GivenTheConfigurationIs(IInternalConfiguration config)
{
_config = config;
}
@ -73,7 +71,7 @@ namespace Ocelot.UnitTests.Configuration
_result.IsError.ShouldBeFalse();
}
class FakeConfig : IOcelotConfiguration
class FakeConfig : IInternalConfiguration
{
private readonly string _downstreamTemplatePath;