Exemplo n.º 1
0
 private static void Test(int upperBound, int expected)
 {
     var fibs = new FibonacciGenerator().GenerateToLessThan(upperBound);
     var evens = new EvenFilter().GetValues(fibs);
     var result = evens.Sum();
     result.Should().Be(expected);
 }
Exemplo n.º 2
0
        private static void Test(int upperBound, int expected)
        {
            var fibs   = new FibonacciGenerator().GenerateToLessThan(upperBound);
            var evens  = new EvenFilter().GetValues(fibs);
            var result = evens.Sum();

            result.Should().Be(expected);
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            var fibs = new FibonacciGenerator().GenerateToLessThan(4000000);
            var evens = new EvenFilter().GetValues(fibs);
            var result = evens.Sum();

            Console.WriteLine("The result is: {0}", result);
            Console.ReadLine();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            var fibs   = new FibonacciGenerator().GenerateToLessThan(4000000);
            var evens  = new EvenFilter().GetValues(fibs);
            var result = evens.Sum();

            Console.WriteLine("The result is: {0}", result);
            Console.ReadLine();
        }
Exemplo n.º 5
0
 private static void TestWithEvens(int[] ints, IEnumerable <int> expectation)
 {
     int[] sequence = new EvenFilter().GetValues(ints);
     sequence.ShouldAllBeEquivalentTo(expectation);
 }
Exemplo n.º 6
0
 private static void TestNoEvens(int[] ints)
 {
     int[] sequence = new EvenFilter().GetValues(ints);
     sequence.Should().BeEmpty();
 }
Exemplo n.º 7
0
 private static void TestWithEvens(int[] ints, IEnumerable<int> expectation)
 {
     int[] sequence = new EvenFilter().GetValues(ints);
     sequence.ShouldAllBeEquivalentTo(expectation);
 }
Exemplo n.º 8
0
 private static void TestNoEvens(int[] ints)
 {
     int[] sequence = new EvenFilter().GetValues(ints);
     sequence.Should().BeEmpty();
 }