예제 #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);
        }
예제 #2
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);
        }
예제 #3
0
        public void SearchByEuclid_GoodNums_ReturnsGCD(long expectedRes, params long[] nums)
        {
            long gcd = FindGCD.SearchByEuclid(nums);

            Assert.AreEqual(expectedRes, gcd);
        }
예제 #4
0
        public void SearchByEuclid_LeftNumGreaterThenRight_ReturnsGCD(long a, long b, long expectedRes)
        {
            long gcd = FindGCD.SearchByEuclid(a, b);

            Assert.AreEqual(expectedRes, gcd);
        }