public void divNegativeTestMethod() { Calculator.Program p = new Calculator.Program(); double number = -8; double number2 = 4; Assert.AreEqual(-2, p.div(number, number2)); }
public void divByZeroTestMethod() { double number = 8; Calculator.Program p = new Calculator.Program(); double number2 = 0; try { p.div(number, number2); Assert.Fail(); } catch (DivideByZeroException) { Assert.Pass("Your first passing test"); } }