public void should_use_consul_service_discovery_and_load_balance_request()
        {
            var consulPort                    = RandomPortFinder.GetRandomPort();
            var servicePort1                  = RandomPortFinder.GetRandomPort();
            var servicePort2                  = RandomPortFinder.GetRandomPort();
            var serviceName                   = "product";
            var downstreamServiceOneUrl       = $"http://localhost:{servicePort1}";
            var downstreamServiceTwoUrl       = $"http://localhost:{servicePort2}";
            var fakeConsulServiceDiscoveryUrl = $"http://localhost:{consulPort}";
            var serviceEntryOne               = new ServiceEntry()
            {
                Service = new AgentService()
                {
                    Service = serviceName,
                    Address = "localhost",
                    Port    = servicePort1,
                    ID      = Guid.NewGuid().ToString(),
                    Tags    = new string[0]
                },
            };
            var serviceEntryTwo = new ServiceEntry()
            {
                Service = new AgentService()
                {
                    Service = serviceName,
                    Address = "localhost",
                    Port    = servicePort2,
                    ID      = Guid.NewGuid().ToString(),
                    Tags    = new string[0]
                },
            };

            var configuration = new FileConfiguration
            {
                Routes = new List <FileRoute>
                {
                    new FileRoute
                    {
                        DownstreamPathTemplate = "/",
                        DownstreamScheme       = "http",
                        UpstreamPathTemplate   = "/",
                        UpstreamHttpMethod     = new List <string> {
                            "Get"
                        },
                        ServiceName         = serviceName,
                        LoadBalancerOptions = new FileLoadBalancerOptions {
                            Type = "LeastConnection"
                        },
                    }
                },
                GlobalConfiguration = new FileGlobalConfiguration()
                {
                    ServiceDiscoveryProvider = new FileServiceDiscoveryProvider()
                    {
                        Scheme = "http",
                        Host   = "localhost",
                        Port   = consulPort
                    }
                }
            };

            this.Given(x => x.GivenProductServiceOneIsRunning(downstreamServiceOneUrl, 200))
            .And(x => x.GivenProductServiceTwoIsRunning(downstreamServiceTwoUrl, 200))
            .And(x => x.GivenThereIsAFakeConsulServiceDiscoveryProvider(fakeConsulServiceDiscoveryUrl, serviceName))
            .And(x => x.GivenTheServicesAreRegisteredWithConsul(serviceEntryOne, serviceEntryTwo))
            .And(x => _steps.GivenThereIsAConfiguration(configuration))
            .And(x => _steps.GivenOcelotIsRunningWithConsul())
            .When(x => _steps.WhenIGetUrlOnTheApiGatewayMultipleTimes("/", 50))
            .Then(x => x.ThenTheTwoServicesShouldHaveBeenCalledTimes(50))
            .And(x => x.ThenBothServicesCalledRealisticAmountOfTimes(24, 26))
            .BDDfy();
        }