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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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