public void OnlyItemReturnedEveryTime()
        {
            var balancer = new RoundRobinBalancer <Uri>();

            balancer.Resources.Add(new Uri("http://test.local"));

            var sameAsFirst = balancer.GetResource();

            sameAsFirst.Should().NotBeNull();

            foreach (var _ in Enumerable.Range(1, 100))
            {
                balancer.GetResource().Should().Be(sameAsFirst);
            }
        }
        public void ReturnsItemsInOrderWrappingAroundToFirst()
        {
            var balancer = new RoundRobinBalancer <Uri>();

            balancer.Resources.Add(new Uri("http://one.test"));
            balancer.Resources.Add(new Uri("http://two.test"));
            balancer.Resources.Add(new Uri("http://three.test"));

            balancer.GetResource().Should().Be(new Uri("http://one.test"));
            balancer.GetResource().Should().Be(new Uri("http://two.test"));
            balancer.GetResource().Should().Be(new Uri("http://three.test"));
            balancer.GetResource().Should().Be(new Uri("http://one.test"));
            balancer.GetResource().Should().Be(new Uri("http://two.test"));
            balancer.GetResource().Should().Be(new Uri("http://three.test"));
        }
        public void NothingReturnedWhenNoEntries()
        {
            var balancer = new RoundRobinBalancer <Uri>();

            balancer.GetResource().Should().BeNull();
        }