예제 #1
0
        public void CalculateFactorial_PositiveInteger_ReturnsFactorialOfArgument(int testIndex, int expectedResult)
        {
            var result = ClassicRecursion.CalculateFactorial(testIndex);

            Assert.AreEqual(expectedResult, result);
        }
예제 #2
0
 public void CalculateFactorial_NegativeNumber_ThrowsArgumentOutOfRangeException(int outOfRangeTestIndex)
 {
     Assert.ThrowsException <ArgumentOutOfRangeException>(() => ClassicRecursion.CalculateFactorial(outOfRangeTestIndex));
 }
예제 #3
0
        public void GetFibonacciNumber_WhenCalled_ReturnsFibonacciNumber(int testIndex, int expectedResult)
        {
            var result = ClassicRecursion.GetFibonacciNumber(testIndex);

            Assert.AreEqual(expectedResult, result);
        }