Beispiel #1
0
        public void Factorial_ArgumentException_When_Factorial_BelowZero()
        {
            // assemble
            Mathematics.MathLib target = new Mathematics.MathLib(Mathematics.MathLib.CalculationTyps.Recursive);

            // act
            target.Factorial(-15);
        }
Beispiel #2
0
        public void Factorial_1_When_RecursiveFactorial_0()
        {
            // assemble
            BigInteger actual;
            BigInteger expected = 1;

            Mathematics.MathLib target = new Mathematics.MathLib(Mathematics.MathLib.CalculationTyps.Recursive);

            // act
            actual = target.Factorial(0);

            // assert
            Assert.AreEqual(expected, actual);
        }
Beispiel #3
0
        public void Factorial_362880_When_ListFactorial_9()
        {
            // assemble
            BigInteger actual;
            BigInteger expected = 362880;

            Mathematics.MathLib target = new Mathematics.MathLib(Mathematics.MathLib.CalculationTyps.List);

            // act
            actual = target.Factorial(9);

            // assert
            Assert.AreEqual(expected, actual);
        }
Beispiel #4
0
        public void Factorial_2432902008176640000_When_ListFactorial_20()
        {
            // assemble
            BigInteger actual;
            BigInteger expected = 2432902008176640000;

            Mathematics.MathLib target = new Mathematics.MathLib(Mathematics.MathLib.CalculationTyps.List);

            // act
            actual = target.Factorial(20);

            // assert
            Assert.AreEqual(expected, actual);
        }