Пример #1
0
        public void BinaryGCDAlgorithmTest8()
        {
            GCDFinder gcdFinder = new GCDFinder();

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

            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void EuclideanAlgorithmTest6()
        {
            GCDFinder gcdFinder = new GCDFinder();

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

            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        public void EuclideanAlgorithmTest5()
        {
            GCDFinder gcdFinder = new GCDFinder();

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

            Assert.AreEqual(expected, actual);
        }
Пример #4
0
        public void EuclideanAlgorithmTest7()
        {
            GCDFinder gcdFinder = new GCDFinder();

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

            Assert.AreEqual(expected, actual);
        }
Пример #5
0
        public void EuclideanAlgorithmTest3()
        {
            GCDFinder gcdFinder = new GCDFinder();

            int expected = 106;
            int actual   = gcdFinder.Find(true, 106, 0);

            Assert.AreEqual(expected, actual);
        }
Пример #6
0
        public void EuclideanAlgorithmTest4()
        {
            GCDFinder gcdFinder = new GCDFinder();

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

            Assert.AreEqual(expected, actual);
        }
Пример #7
0
        public void BinaryGCDAlgorithmTest9()
        {
            GCDFinder gcdFinder = new GCDFinder();

            int expected = 100;
            int actual   = gcdFinder.Find(false, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100);

            Assert.AreEqual(expected, actual);
        }
Пример #8
0
        public void BinaryGCDAlgorithmTest7()
        {
            GCDFinder gcdFinder = new GCDFinder();

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

            Assert.AreEqual(expected, actual);
        }
Пример #9
0
        public void BinaryGCDAlgorithmTest6()
        {
            GCDFinder gcdFinder = new GCDFinder();

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

            Assert.AreEqual(expected, actual);
        }
Пример #10
0
        public void BinaryGCDAlgorithmTest5()
        {
            GCDFinder gcdFinder = new GCDFinder();

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

            Assert.AreEqual(expected, actual);
        }
Пример #11
0
        public void BinaryGCDAlgorithmTest4()
        {
            GCDFinder gcdFinder = new GCDFinder();

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

            Assert.AreEqual(expected, actual);
        }
Пример #12
0
        public void BinaryGCDAlgorithmZeroArgumentAllZerosTest2()
        {
            GCDFinder gcdFinder = new GCDFinder();

            Assert.Throws <ArgumentException>(() => gcdFinder.Find(false, 0, 0, 0, 0, 0, 0, 0, 0), "All arguments can't be equal to 0 at the same time.");
        }
Пример #13
0
        public void BinaryGCDAlgorithmZeroArgumentsTest()
        {
            GCDFinder gcdFinder = new GCDFinder();

            Assert.Throws <ArgumentException>(() => gcdFinder.Find(false), "There should be at least 2 numbers.");
        }
Пример #14
0
        public void BinaryGCDAlgorithmWithMinimalIntTest2()
        {
            GCDFinder gcdFinder = new GCDFinder();

            Assert.Throws <ArgumentException>(() => gcdFinder.Find(false, int.MaxValue, int.MinValue), "Value can't be equal to minimal integer.");
        }
Пример #15
0
        public void EuclideanAlgorithmMinimalIntTest1()
        {
            GCDFinder gcdFinder = new GCDFinder();

            Assert.Throws <ArgumentException>(() => gcdFinder.Find(true, 256, int.MinValue), "Value can't be equal to minimal integer.");
        }
Пример #16
0
        public void EuclideanAlgorithmZeroArgumentAllZerosTest1()
        {
            GCDFinder gcdFinder = new GCDFinder();

            Assert.Throws <ArgumentException>(() => gcdFinder.Find(true, 0, 0), "All arguments can't be equal to 0 at the same time.");
        }
Пример #17
0
        public void EuclideanAlgorithmOneArgumentTest()
        {
            GCDFinder gcdFinder = new GCDFinder();

            Assert.Throws <ArgumentException>(() => gcdFinder.Find(true, 11), "There should be at least 2 numbers.");
        }