public void PrimeCheckRec_DivideByZeroException_Test() { int num = 1; int divisor = 0; Assert.Throws <DivideByZeroException> (() => r.PrimeCheckRec(num, divisor)); var ex = Assert.Throws <DivideByZeroException> (() => r.PrimeCheckRec(num, divisor)); Assert.Equal("Attempted to divide by zero.", ex.Message); }
public void PrimeCheckRec() { int num = 1; int divisor = 0; // r.PrimeCheckRec (num, divisor); Assert.Throws <Exception> (() => r.PrimeCheckRec(num, divisor)); var ex = Assert.Throws <Exception> (() => r.PrimeCheckRec(num, divisor)); Assert.Equal("Error, can't divide by zero.", ex.Message); }
public void PrimeCheckRec_Test() { int num = 1; int divisor = 1; bool primecheckrecresult = true; Assert.Equal(primecheckrecresult, r.PrimeCheckRec(num, divisor)); }
public void PrimeCheckRecTest(int primenum, int divisor) { RecursiveCalc r = new RecursiveCalc(); Assert.Throws <DivideByZeroException> (() => r.PrimeCheckRec(primenum, divisor)); }