Exemple #1
0
        public void SearchByStein_ArrayLengthLessThanTwo_ThrowsArgumentExceptions(params long[] nums)
        {
            var ex = Assert.Catch <ArgumentException>(() => FindGCD.SearchByEuclid(nums));

            StringAssert.Contains("Value does not fall within the expected range.", ex.Message);
        }
Exemple #2
0
        public void SearchByStein_LeftNumGreaterThenRight_ReturnsGCD(long a, long b, long expectedRes)
        {
            long gcd = FindGCD.SearchByStein(a, b);

            Assert.AreEqual(expectedRes, gcd);
        }
Exemple #3
0
        public void SearchByStein_GoodNums_ReturnsGCD(long expectedRes, params long[] nums)
        {
            long gcd = FindGCD.SearchByStein(nums);

            Assert.AreEqual(expectedRes, gcd);
        }
Exemple #4
0
        public void SearchByEuclid_ThreeParams_ReturnsGCD(long a, long b, long c, long expectedRes)
        {
            long gcd = FindGCD.SearchByEuclid(a, b, c);

            Assert.AreEqual(expectedRes, gcd);
        }