diff --git a/test/Ocelot.UnitTests/Configuration/InMemoryConfigurationRepositoryTests.cs b/test/Ocelot.UnitTests/Configuration/InMemoryConfigurationRepositoryTests.cs index 8e0e66d3..8d28b112 100644 --- a/test/Ocelot.UnitTests/Configuration/InMemoryConfigurationRepositoryTests.cs +++ b/test/Ocelot.UnitTests/Configuration/InMemoryConfigurationRepositoryTests.cs @@ -27,7 +27,7 @@ namespace Ocelot.UnitTests.Configuration [Fact] public void can_add_config() { - this.Given(x => x.GivenTheConfigurationIs(new FakeConfig("initial"))) + this.Given(x => x.GivenTheConfigurationIs(new FakeConfig("initial", "adminath"))) .When(x => x.WhenIAddOrReplaceTheConfig()) .Then(x => x.ThenNoErrorsAreReturned()) .BDDfy(); @@ -54,7 +54,7 @@ namespace Ocelot.UnitTests.Configuration private void GivenThereIsASavedConfiguration() { - GivenTheConfigurationIs(new FakeConfig("initial")); + GivenTheConfigurationIs(new FakeConfig("initial", "adminath")); WhenIAddOrReplaceTheConfig(); } @@ -77,17 +77,10 @@ namespace Ocelot.UnitTests.Configuration { private readonly string _downstreamTemplatePath; - public FakeConfig(string downstreamTemplatePath) + public FakeConfig(string downstreamTemplatePath, string administrationPath) { _downstreamTemplatePath = downstreamTemplatePath; - } - - public string AdministrationPath - { - get - { - throw new NotImplementedException(); - } + AdministrationPath = administrationPath; } public List ReRoutes => new List @@ -97,6 +90,8 @@ namespace Ocelot.UnitTests.Configuration .WithUpstreamHttpMethod("Get") .Build() }; + + public string AdministrationPath {get;} } } } diff --git a/test/Ocelot.UnitTests/Controllers/FileConfigurationControllerTests.cs b/test/Ocelot.UnitTests/Controllers/FileConfigurationControllerTests.cs index cbd8aeac..cd2ab4ce 100644 --- a/test/Ocelot.UnitTests/Controllers/FileConfigurationControllerTests.cs +++ b/test/Ocelot.UnitTests/Controllers/FileConfigurationControllerTests.cs @@ -1,7 +1,5 @@ -using System.Collections.Generic; using Microsoft.AspNetCore.Mvc; using Moq; -using Ocelot.Configuration; using Ocelot.Configuration.File; using Ocelot.Controllers; using Ocelot.Responses; @@ -30,7 +28,7 @@ namespace Ocelot.UnitTests.Controllers this.Given(x => x.GivenTheGetConfigurationReturns(expected)) .When(x => x.WhenIGetTheFileConfiguration()) - .Then(x => x.ThenTheFileConfigurationIsReturned(expected.Data)) + .Then(x => x.TheTheGetFileConfigurationIsCalledCorrectly()) .BDDfy(); } @@ -46,8 +44,10 @@ namespace Ocelot.UnitTests.Controllers _result = _controller.Get(); } - private void ThenTheFileConfigurationIsReturned(FileConfiguration expected) + private void TheTheGetFileConfigurationIsCalledCorrectly() { + _getFileConfig + .Verify(x => x.Invoke(), Times.Once); } } } \ No newline at end of file