private int GetGcd(int[] numbers, string algorithmType) { if (algorithmType == "euclidiean") { return(GCDAlgorithms.GetEuclidieanGcd(numbers)); } else { return(GCDAlgorithms.GetSteinGcd(numbers)); } }
public int SteinGCD_ConreteArrayOfNumbers_ReturnResult(int[] numbers) { return(GCDAlgorithms.GetSteinGcd(out _, numbers)); }
public void SteinGCD_ArrayHasOneElement_ThrowArgumentException() => Assert.Throws <ArgumentException>(() => GCDAlgorithms.GetSteinGcd(new int[] { 12 }));
public void SteinGCD_ArrayIsEmpty_ThrowArgumentException() => Assert.Throws <ArgumentException>(() => GCDAlgorithms.GetSteinGcd(new int[] { }));
public void SteinGCD_ArrayIsNull_ThrowArgumentNullException() => Assert.Throws <ArgumentNullException>(() => GCDAlgorithms.GetSteinGcd(null));
public int SteinGCD_ThreeNumbers_ReturnResult(int a, int b, int c) { return(GCDAlgorithms.GetSteinGcd(out _, a, b, c)); }
public void SteinGCD_ThreeNumbersAreZeros_ThrowArgumentException() => Assert.Throws <ArgumentException>(() => GCDAlgorithms.GetSteinGcd(0, 0, 0));
public int SteinGCD_TwoNumbersPassed_ReturnResult(int a, int b) { int result = GCDAlgorithms.GetSteinGcd(out _, a, b); return(result); }
public void SteinGCD_TwoNumbersAreIntMinValue_ThrowArgumentException() => Assert.Throws <ArgumentException>(() => GCDAlgorithms.GetSteinGcd(int.MinValue, int.MinValue));