Пример #1
0
        public void TestEuclidGCDMax()
        {
            //arrange
            int[] valueException = { Int32.MaxValue, Int32.MinValue };

            //assert
            Assert.ThrowsException <ArgumentException>(() => GCD.EuclidGCD(valueException));
        }
Пример #2
0
        public void TestEuclidGCDRandThird()
        {
            //arrange
            int[] value = { 7, 9, 13, 23, 28, 12, 12 };

            //act
            long val = GCD.EuclidGCD(value);

            //assert
            Assert.AreEqual(1, val);
        }
Пример #3
0
        public void TestEuclidGCDRandSecond()
        {
            //arrange
            int[] value = { 3, 6, 9, 12, 15, 18 };

            //act
            long val = GCD.EuclidGCD(value);

            //assert
            Assert.AreEqual(3, val);
        }
Пример #4
0
        public void TestEuclidGCDRandFirst()
        {
            //arrange
            int[] value = { 5, 10, 15 };

            //act
            long val = GCD.EuclidGCD(value);

            //assert
            Assert.AreEqual(5, val);
        }
Пример #5
0
        public void TestEuclidGCDZero()
        {
            //arrange
            int[] value = { 0, 0, 0, 0 };

            //act
            long val = GCD.EuclidGCD(value);

            //assert
            Assert.AreEqual(0, val);
        }
Пример #6
0
 public int EucideanTests_FiveElementsValidData_ValidResult(int first, int second, int third, int four, int five)
 {
     return(GCD.EuclidGCD(out _, first, second, third, four, five));
 }
Пример #7
0
 public int EucideanTests_ThreeElementsValidData_ValidResult(int first, int second, int third)
 {
     return(GCD.EuclidGCD(out _, first, second, third));
 }
Пример #8
0
 public void EucideanTests_EmptyArray_ArgumentNullException()
 => Assert.Throws(typeof(ArgumentNullException), () => GCD.EuclidGCD(out _, null));
Пример #9
0
 public void EucideanTests_LessThenThowElements_ArgumentException()
 => Assert.Throws(typeof(ArgumentException), () => GCD.EuclidGCD(out _, 1));