public void FactoriseReturnsTwoAndOtherFactorWhenNumberIsEven(int evenNumber) { Factoriser factoriser = new Factoriser(); (int, int)factors = factoriser.factorise(evenNumber); Assert.Equal(factors, (2, evenNumber / 2)); }
public static void Main(string[] args) { int numberToFactorise = 15; (int, int)result = new Factoriser().factorise(numberToFactorise); Console.WriteLine($"The factors of {numberToFactorise} are {result.Item1} and {result.Item2}"); }
public void FactoriseReturnsErrorWhenLessThanTwo(int numberLessThanTwo) { Factoriser factoriser = new Factoriser(); Action act = () => factoriser.factorise(numberLessThanTwo); Assert.Throws <ArgumentException>(act); }