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

            Assert.AreEqual(expectedRes, gcd);
        }
Exemplo n.º 4
0
        public void SearchByEuclid_LeftNumGreaterThenRight_ReturnsGCD(long a, long b, long expectedRes)
        {
            long gcd = FindGCD.SearchByEuclid(a, b);

            Assert.AreEqual(expectedRes, gcd);
        }