예제 #1
0
        public void EuclideanAlgorithmTest8()
        {
            GCDFinder gcdFinder = new GCDFinder();

            int expected = 1;
            int actual   = gcdFinder.EuclideanAlgorithm(123451, 1231246, -34698693, 12364568, -124752344, -1231245, 9999999);

            Assert.AreEqual(expected, actual);
        }
예제 #2
0
        public void EuclideanAlgorithmTest9()
        {
            GCDFinder gcdFinder = new GCDFinder();

            int expected = 100;
            int actual   = gcdFinder.EuclideanAlgorithm(100, 100, 100, 100, 100, 100, 100, 100, 100, 100);

            Assert.AreEqual(expected, actual);
        }
예제 #3
0
        public void EuclideanAlgorithmTest7()
        {
            GCDFinder gcdFinder = new GCDFinder();

            int expected = 1221;
            int actual   = gcdFinder.EuclideanAlgorithm(-0, 0, -0, 1221, 0, -0, 0);

            Assert.AreEqual(expected, actual);
        }
예제 #4
0
        public void EuclideanAlgorithmTest6()
        {
            GCDFinder gcdFinder = new GCDFinder();

            int expected = 17;
            int actual   = gcdFinder.EuclideanAlgorithm(-34, 68, -136, 17, -272);

            Assert.AreEqual(expected, actual);
        }
예제 #5
0
        public void EuclideanAlgorithmTest5()
        {
            GCDFinder gcdFinder = new GCDFinder();

            int expected = 1;
            int actual   = gcdFinder.EuclideanAlgorithm(int.MaxValue, 17);

            Assert.AreEqual(expected, actual);
        }
예제 #6
0
        public void EuclideanAlgorithmTest4()
        {
            GCDFinder gcdFinder = new GCDFinder();

            int expected = 1;
            int actual   = gcdFinder.EuclideanAlgorithm(105, 95, 107, 22, 14);

            Assert.AreEqual(expected, actual);
        }
예제 #7
0
        public void EuclideanAlgorithmTest2()
        {
            GCDFinder gcdFinder = new GCDFinder();

            int expected = 3;
            int actual   = gcdFinder.EuclideanAlgorithm(18, 6, 3);

            Assert.AreEqual(expected, actual);
        }
예제 #8
0
        public void EuclideanAlgorithmZeroArgumentAllZerosTest2()
        {
            GCDFinder gcdFinder = new GCDFinder();

            Assert.Throws <ArgumentException>(() => gcdFinder.EuclideanAlgorithm(0, 0, 0, 0, 0, 0, 0, 0), "All arguments can't be equal to 0 at the same time.");
        }
예제 #9
0
        public void EuclideanAlgorithmZeroArgumentsTest()
        {
            GCDFinder gcdFinder = new GCDFinder();

            Assert.Throws <ArgumentException>(() => gcdFinder.EuclideanAlgorithm(), "There should be at least 2 numbers.");
        }
예제 #10
0
        public void EuclideanAlgorithmWithMinimalIntTest2()
        {
            GCDFinder gcdFinder = new GCDFinder();

            Assert.Throws <ArgumentException>(() => gcdFinder.EuclideanAlgorithm(int.MaxValue, int.MinValue), "Value can't be equal to minimal integer.");
        }