Esempio n. 1
0
        public void SqareFactorial_ArgumentException_When_Factorial_BelowZero()
        {
            // assemble
            Mathematics.MathLib target = new Mathematics.MathLib(Mathematics.MathLib.CalculationTyps.Recursive);

            // act
            target.SquareFactorial(-15);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 5
0
        public void SquareFactorial_518400_When_RecursiveFactorial_6()
        {
            // assemble
            BigInteger actual;
            BigInteger expected = 518400;

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

            // act
            actual = target.SquareFactorial(6);

            // assert
            Assert.AreEqual(expected, actual);
        }
Esempio n. 6
0
        public void UnevenFactorial_15_When_ListFactorial_6()
        {
            // assemble
            BigInteger actual;
            BigInteger expected = 15;

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

            // act
            actual = target.UnevenFactorial(6);

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