Ejemplo n.º 1
0
        public void TestMethodForEuclideanGCDWithTwoParameters()
        {
            first  = random.Next(-1000, 1000);                             // first random input parametr
            second = random.Next(-1001, 1001);                             // second random input parametr

            result = FindGCD.EuclideanGCD(first, second, out double time); // result of GCD calculation

            if (VerifyGCD(result, first, second))                          // verifying result GCD
            {
                ok = true;
            }
            else
            {
                ok = false;
            }

            Assert.IsTrue(ok);                                  // if ok is true, then test passed
        }
Ejemplo n.º 2
0
        public void TestMethodForEuclideanGCDWithThreeParameters()
        {
            first  = random.Next(-1002, 1002);                      // first random input parametr
            second = random.Next(-1003, 1003);                      // second random input parametr
            third  = random.Next(-1004, 1004);                      // third random input parametr

            result = FindGCD.EuclideanGCD(first, second, third);    // result of GCD calculation

            if (VerifyGCD(result, first, second, third))            // verifying result GCD
            {
                ok = true;
            }
            else
            {
                ok = false;
            }

            Assert.IsTrue(ok);                                  // if ok is true, then test passed
        }
Ejemplo n.º 3
0
        public void TestMethodForEuclideanGCDWithFourParameters()
        {
            first  = random.Next(-1005, 1005);                           // first random input parametr
            second = random.Next(-1006, 1006);                           // second random input parametr
            third  = random.Next(-1007, 1007);                           // third random input parametr
            fourth = random.Next(-1008, 1008);                           // fourth random input parametr

            result = FindGCD.EuclideanGCD(first, second, third, fourth); // result of GCD calculation

            if (VerifyGCD(result, first, second, third, fourth))         // verifying result GCD
            {
                ok = true;
            }
            else
            {
                ok = false;
            }

            Assert.IsTrue(ok);                                  // if ok is true, then test passed
        }