Example #1
0
        public void should_go_back_to_first_address_after_finished_last()
        {
            var stopWatch = Stopwatch.StartNew();

            while (stopWatch.ElapsedMilliseconds < 1000)
            {
                var address = _roundRobin.Lease(_context).Result;
                address.Data.ShouldBe(_services[0].HostAndPort);
                address = _roundRobin.Lease(_context).Result;
                address.Data.ShouldBe(_services[1].HostAndPort);
                address = _roundRobin.Lease(_context).Result;
                address.Data.ShouldBe(_services[2].HostAndPort);
            }
        }