public void SuchThatIt_ReturnsTheCorrectAnswer()
        {
            const int fourMillion        = 4000000;
            const int correctAnswer      = 4613732;
            long      getFibonacciResult = 0;
            var       n = 0;

            while (getFibonacciResult < fourMillion)
            {
                n++;
                getFibonacciResult = stackStrategy.GetFibonacci(n);
            }
            var getSumOfEvenResult = fibonacciCalculator.GetSumOfEvenValuedTerms(n);

            Assert.AreEqual(correctAnswer, getSumOfEvenResult);
        }
Esempio n. 2
0
            public void Returns0_GivenX0()
            {
                var expected = 0;
                var result   = stackStrategy.GetFibonacci(0);

                Assert.AreEqual(expected, result);
            }