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); }
public void TestIterative4(int width, int height, int expected) { Assert.AreEqual(expected, CommonDivisor.FindIterativeWay(width, height)); }
public void TestRecursive3(int width, int height, int expected) { Assert.AreEqual(expected, CommonDivisor.FindRecursiveWay(width, height)); }
public void CommonDivisor_FindGcdByBinary_CalculateRunTime_ValidData_Test(int[] arg1) { Assert.Greater(CommonDivisor.GetRunTimeGcdBinary(arg1), 0); }
public void CommonDivisor_FindGcdByEvklid_InvalidData_Test(int[] arg1) { Assert.Throws <ArgumentException>(() => CommonDivisor.GetRunTimeGcdEvklid(arg1)); }
public void CommonDivisor_FindGcdByEvklig_InvalidData_Test(int[] arg1) { Func <int, int, int> extractMethod = CommonDivisor.GetGcdEvklid; Assert.Throws <ArgumentException>(() => CommonDivisor.FindGcd(extractMethod, arg1)); }
public int CommonDivisor_FindGcdByBinary_ValidData_Test(int[] arg1) { Func <int, int, int> extractMethod = CommonDivisor.GetGcdBinary; return(CommonDivisor.FindGcd(extractMethod, arg1)); }
public void CommonDivisor_FindGcdByBinary_CalculateRunTime_InvalidData_Test(int[] arg1) { Assert.Throws <ArgumentException>(() => CommonDivisor.GetRunTimeGcdBinary(arg1)); }