mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 12:18:16 +08:00
Feature/refactoring internal config creation stack (#600)
* tidy up some code so I can understand it * broke al the things that make config out into their own classes etc..sigh * fix the things i broked * #597 test for issue, works on this branch :E * #597 removed comments * added tests for new load balancer creator..basic * added tests for lb creator and aggregates creator * added tests for config creator * boiler plate for tests * added dynamics tests * wip * finished refactoring for now
This commit is contained in:
@ -37,7 +37,7 @@ namespace Ocelot.UnitTests.DownstreamRouteFinder
|
||||
_handlerOptions = new HttpHandlerOptionsBuilder().Build();
|
||||
_loadBalancerOptions = new LoadBalancerOptionsBuilder().WithType(nameof(NoLoadBalancer)).Build();
|
||||
_qosOptionsCreator
|
||||
.Setup(x => x.Create(It.IsAny<QoSOptions>(), It.IsAny<string>(), It.IsAny<string[]>()))
|
||||
.Setup(x => x.Create(It.IsAny<QoSOptions>(), It.IsAny<string>(), It.IsAny<List<string>>()))
|
||||
.Returns(_qoSOptions);
|
||||
_creator = new DownstreamRouteCreator(_qosOptionsCreator.Object);
|
||||
}
|
||||
@ -198,7 +198,7 @@ namespace Ocelot.UnitTests.DownstreamRouteFinder
|
||||
private void GivenTheQosCreatorReturns(QoSOptions options)
|
||||
{
|
||||
_qosOptionsCreator
|
||||
.Setup(x => x.Create(It.IsAny<QoSOptions>(), It.IsAny<string>(), It.IsAny<string[]>()))
|
||||
.Setup(x => x.Create(It.IsAny<QoSOptions>(), It.IsAny<string>(), It.IsAny<List<string>>()))
|
||||
.Returns(options);
|
||||
}
|
||||
|
||||
@ -260,7 +260,7 @@ namespace Ocelot.UnitTests.DownstreamRouteFinder
|
||||
_result.Data.ReRoute.DownstreamReRoute[0].QosOptions.ShouldBe(expected);
|
||||
_result.Data.ReRoute.DownstreamReRoute[0].QosOptions.UseQos.ShouldBeTrue();
|
||||
_qosOptionsCreator
|
||||
.Verify(x => x.Create(expected, _upstreamUrlPath, It.IsAny<string[]>()), Times.Once);
|
||||
.Verify(x => x.Create(expected, _upstreamUrlPath, It.IsAny<List<string>>()), Times.Once);
|
||||
}
|
||||
|
||||
private void GivenTheConfiguration(IInternalConfiguration config)
|
||||
|
Reference in New Issue
Block a user