示例#1
0
        public void TestGDCNegativePositiveValues()
        {
            //arrange
            int a          = -4;
            int b          = 180;
            int testResult = 4;

            long time = 0;

            //act
            EuclidMethods testEuclid = new EuclidMethods();
            int           result     = testEuclid.GetGDCEuclideanMethod(a, b, out time);

            //assert
            Assert.AreEqual(testResult, result, 0.001, "Something went wrong");
        }
示例#2
0
        public void TestSteinWithNegativePositiveValues()
        {
            //arrange
            int a          = -15;
            int b          = 170;
            int testResult = 5;

            long time = 0;

            //act
            EuclidMethods testEuclid = new EuclidMethods();
            int           result     = testEuclid.GetGCDStain(a, b, out time);

            //assert
            Assert.AreEqual(testResult, result, 0.001, "Something went wrong");
        }
示例#3
0
        public void TestGDC3Positive1NegativeValues()
        {
            //arrange
            int a          = 5;
            int b          = -155;
            int c          = 1455;
            int d          = 204520;
            int testResult = 5;

            long time = 0;

            //act
            EuclidMethods testEuclid = new EuclidMethods();
            int           result     = testEuclid.GetGDCEuclideanMethod(a, b, c, d, out time);

            //assert
            Assert.AreEqual(testResult, result, 0.001, "Something went wrong");
        }
示例#4
0
        public void TestGDC4EqualValues()
        {
            //arrange
            int a          = 4312;
            int b          = 4312;
            int c          = 4312;
            int d          = 4312;
            int testResult = 4312;

            long time = 0;

            //act
            EuclidMethods testEuclid = new EuclidMethods();
            int           result     = testEuclid.GetGDCEuclideanMethod(a, b, c, d, out time);

            //assert
            Assert.AreEqual(testResult, result, 0.001, "Something went wrong");
        }