public void ValuesReturnedContainsAllValuesWithinRangeThatMatchCriteria()
 {
     var iterator = new Iterator(0, 10, i => i % 3 == 0 || i % 5 == 0);
     Assert.That(iterator.GetValues().Contains(3));
     Assert.That(iterator.GetValues().Contains(5));
     Assert.That(iterator.GetValues().Contains(6));
     Assert.That(iterator.GetValues().Contains(9));
 }
        public void AddingAllMultiplesOf3Or5ThatAreLessThan10AddsUpTo23()
        {
            var iterator = new Iterator(0, 10, i => i % 3 == 0 || i % 5 == 0);
            var aggregator = new Aggregator(iterator);
            int result = aggregator.GetSum();

            Assert.That(result, Is.EqualTo(23));
        }
        public void AddAllMultiplesOf3Or5ThatAreLessThan1000AddsUpTo233168()
        {
            var iterator = new Iterator(0, 1000, i => i % 3 == 0 || i % 5 == 0);
            var aggregator = new Aggregator(iterator);
            int result = aggregator.GetSum();

            Assert.That(result, Is.EqualTo(233168)); // see Verification.xls for confirmation of this result.
        }
 public void ValuesReturnedAreAllLessThanTheMaximumValue()
 {
     var iterator = new Iterator(0, 10, i => i % 3 == 0 || i % 5 == 0);
     Assert.That(iterator.GetValues().All(i => i < 10));
 }
 public void ValuesReturnedAreAllGreaterThanOrEqualToTheMinimumValue()
 {
     var iterator = new Iterator(0, 10, i => i % 3 == 0 || i % 5 == 0);
     Assert.That(iterator.GetValues().All(i => i >= 0));
 }
 public void IteratorReturnsValues()
 {
     var iterator = new Iterator(0, 10, i => i % 3 == 0 || i % 5 == 0);
     Assert.That(iterator.GetValues().Any());
 }