public void TestFactorialOfOneIsOne()
        {
            // act
            BigInteger result1 = BigIntegerMathLib.Factorial1(1);
            BigInteger result2 = BigIntegerMathLib.Factorial2(1);

            // assert
            BigInteger one = 1;

            Assert.AreEqual(one, result1);
            Assert.AreEqual(one, result2);
        }
        public void TestBothVersionsOfFactorialAreEqual()
        {
            for (BigInteger n = 0; n < 100; n++)
            {
                // act
                BigInteger factorial1 = BigIntegerMathLib.Factorial1(n);
                BigInteger factorial2 = BigIntegerMathLib.Factorial2(n);

                // assert
                Assert.AreEqual(factorial1, factorial2);
            }
        }
        public void TestFactorialBigIntegerEqualsFactorialInt()
        {
            for (int n = 0; n < 10; n++)
            {
                // act
                int        factorial0 = BigIntegerMathLib.Factorial0(n);
                BigInteger factorial1 = BigIntegerMathLib.Factorial1(n);

                // assert
                Assert.AreEqual((BigInteger)factorial0, factorial1);
                Assert.AreEqual(factorial0, (int)factorial1);
            }
        }
 public void TestFactorial1OfNegativeNumberThrowsArgumentException()
 {
     // assert
     Assert.That(() => BigIntegerMathLib.Factorial1(-1), Throws.TypeOf <ArgumentException>());
 }