コード例 #1
0
 private LoadBalancerOptions CreateLoadBalancerOptions(FileLoadBalancerOptions options)
 {
     return(new LoadBalancerOptionsBuilder()
            .WithType(options.Type)
            .WithKey(options.Key)
            .WithExpiryInMs(options.Expiry)
            .Build());
 }
コード例 #2
0
 public FileGlobalConfiguration()
 {
     ServiceDiscoveryProvider = new FileServiceDiscoveryProvider();
     RateLimitOptions         = new FileRateLimitOptions();
     LoadBalancerOptions      = new FileLoadBalancerOptions();
     QoSOptions         = new FileQoSOptions();
     HttpHandlerOptions = new FileHttpHandlerOptions();
 }
コード例 #3
0
        public void should_create()
        {
            var fileLoadBalancerOptions = new FileLoadBalancerOptions
            {
                Type   = "test",
                Key    = "west",
                Expiry = 1
            };

            this.Given(_ => GivenThe(fileLoadBalancerOptions))
            .When(_ => WhenICreate())
            .Then(_ => ThenTheOptionsAreCreated(fileLoadBalancerOptions))
            .BDDfy();
        }
コード例 #4
0
 private void GivenThe(FileLoadBalancerOptions fileLoadBalancerOptions)
 {
     _fileLoadBalancerOptions = fileLoadBalancerOptions;
 }
コード例 #5
0
 private void ThenTheOptionsAreCreated(FileLoadBalancerOptions expected)
 {
     _result.Type.ShouldBe(expected.Type);
     _result.Key.ShouldBe(expected.Key);
     _result.ExpiryInMs.ShouldBe(expected.Expiry);
 }