public void SuchThatIt_ReturnsTheCorrectAnswer() { const int fourMillion = 4000000; const int correctAnswer = 4613732; long getFibonacciResult = 0; var n = 0; while (getFibonacciResult < fourMillion) { n++; getFibonacciResult = fibonacciCalculator.GetFibonacciUsingAStack(n); } var getSumOfEvenResult = fibonacciCalculator.GetSumOfEvenValuedTerms(n); Assert.AreEqual(correctAnswer, getSumOfEvenResult); }
public void ReturnsCorrectAnswer() { const int fourMillion = 4000000; const int problemTwoAnswer = 4613732; long getFibonacciUsingRecurrsionResult = 0; var n = 0; while (getFibonacciUsingRecurrsionResult < fourMillion) { n++; getFibonacciUsingRecurrsionResult = fibonacciCalculator.GetFibonacciUsingAStack(n); } var getSumOfEvenResult = fibonacciCalculator.GetSumOfEvenValuedTerms(n); Assert.AreEqual(problemTwoAnswer, getSumOfEvenResult); }
public void Returns0_GivenX0() { var expected = 0; var result = problem2.GetSumOfEvenValuedTerms(0); Assert.AreEqual(expected, result); }
public void Returns0_GivenX0() { var expected = 0; var result = fibonacciCalculator.GetSumOfEvenValuedTerms(0); Assert.AreEqual(expected, result); }