예제 #1
0
        public void TheSumOfAllMultiplesOf3Or5Below10Equals23()
        {
            var iterator = new Iterator<int>(0, 10, isMultipleOf3Or5, i => i + 1);
            var aggregator = new Aggregator(iterator);

            int result = aggregator.GetSum();
            Assert.That(result, Is.EqualTo(23));
        }
예제 #2
0
        public void CanSumAllMultiplesOf3Or5Below1000()
        {
            var iterator = new Iterator<int>(0, 1000, isMultipleOf3Or5, i => i + 1);
            var aggregator = new Aggregator(iterator);

            int result = aggregator.GetSum();

            // Not asserting the answer here, as I can't find what the accepted answer is.
            Trace.WriteLine(string.Format("Result: {0}", result)); // returns 33165.
        }