public void Factorial_should_return_same_result_for_all_implementations(int n)
        {
            var basicResult      = BasicRecursion.Factorial(n);
            var tailResult       = TailRecursion.Factorial(n);
            var iterrativeResult = Iterative.Factorial(n);
            var enumerableResult = Enumerable.Factorial(n);

            Assert.That(basicResult, Is.EqualTo(tailResult));
            Assert.That(basicResult, Is.EqualTo(iterrativeResult));
            Assert.That(basicResult, Is.EqualTo(enumerableResult));
        }
Beispiel #2
0
 public int BasicRecursionTest()
 {
     return(BasicRecursion.Factorial(N));
 }