Esempio n. 1
0
        public void Test30()
        {
            BigInteger res = ExtraLongFactorials.CalcExtraLongFactorial(30);
            BigInteger ans = BigInteger.Parse("265252859812191058636308480000000");

            Assert.AreEqual(ans, res);
        }
Esempio n. 2
0
        public void Test50()
        {
            BigInteger res = ExtraLongFactorials.CalcExtraLongFactorial(50);
            BigInteger ans = BigInteger.Parse("30414093201713378043612608166064768844377641568960512000000000000");

            Assert.AreEqual(ans, res);
        }
Esempio n. 3
0
        public void Test25()
        {
            BigInteger res = ExtraLongFactorials.CalcExtraLongFactorial(25);
            BigInteger ans = BigInteger.Parse("15511210043330985984000000");

            Assert.AreEqual(ans, res);
        }
Esempio n. 4
0
        public void MultiplyByAdd_WhenDataIsBig_ReturnsRightData(int input1, int input2, string mult)
        {
            var result       = ExtraLongFactorials.MultiplyByAdd(input1, input2);
            var stringResult = String.Join("", result);

            Assert.AreEqual(mult, stringResult);
        }
Esempio n. 5
0
        public void Run_IfNumberIsTooBig_StillCalculate()
        {
            var result   = ExtraLongFactorials.Run(25);
            var expected = "15511210043330985984000000";
            var happened = String.Join("", result);

            Assert.IsTrue(string.Equals(expected, happened, StringComparison.OrdinalIgnoreCase));
        }
Esempio n. 6
0
        public void BaseCase(int n)
        {
            BigInteger res = ExtraLongFactorials.CalcExtraLongFactorial(n);

            Assert.AreEqual(new BigInteger(1), res);
        }
Esempio n. 7
0
        public void Add_WhenDataIsNormal_ReturnsRightData(string input1, string input2, string added)
        {
            var result = ExtraLongFactorials.Add(input1, input2);

            Assert.AreEqual(added, result);
        }
Esempio n. 8
0
 public ExtraLongFactorialsTest()
 {
     elF = new ExtraLongFactorials();
 }