Ejemplo n.º 1
0
        public async Task GenericCommonDivisorTest(CommonDivisionType commonDivisionType, IList <int> sequence, int expected)
        {
            var commonDivisor = new CommonDivisor();

            var randomSequence = new List <int>();

            randomSequence.AddRange(sequence);

            var result = await commonDivisor.StartAndReturnResult(randomSequence, commonDivisionType).ConfigureAwait(false);

            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 2
0
 public void TestIterative4(int width, int height, int expected)
 {
     Assert.AreEqual(expected, CommonDivisor.FindIterativeWay(width, height));
 }
Ejemplo n.º 3
0
 public void TestRecursive3(int width, int height, int expected)
 {
     Assert.AreEqual(expected, CommonDivisor.FindRecursiveWay(width, height));
 }
Ejemplo n.º 4
0
 public void CommonDivisor_FindGcdByBinary_CalculateRunTime_ValidData_Test(int[] arg1)
 {
     Assert.Greater(CommonDivisor.GetRunTimeGcdBinary(arg1), 0);
 }
Ejemplo n.º 5
0
 public void CommonDivisor_FindGcdByEvklid_InvalidData_Test(int[] arg1)
 {
     Assert.Throws <ArgumentException>(() => CommonDivisor.GetRunTimeGcdEvklid(arg1));
 }
Ejemplo n.º 6
0
        public void CommonDivisor_FindGcdByEvklig_InvalidData_Test(int[] arg1)
        {
            Func <int, int, int> extractMethod = CommonDivisor.GetGcdEvklid;

            Assert.Throws <ArgumentException>(() => CommonDivisor.FindGcd(extractMethod, arg1));
        }
Ejemplo n.º 7
0
        public int CommonDivisor_FindGcdByBinary_ValidData_Test(int[] arg1)
        {
            Func <int, int, int> extractMethod = CommonDivisor.GetGcdBinary;

            return(CommonDivisor.FindGcd(extractMethod, arg1));
        }
Ejemplo n.º 8
0
 public void CommonDivisor_FindGcdByBinary_CalculateRunTime_InvalidData_Test(int[] arg1)
 {
     Assert.Throws <ArgumentException>(() => CommonDivisor.GetRunTimeGcdBinary(arg1));
 }