public void DivTest() { //Arrange frmUnitTest objtest = new frmUnitTest(); String fno = "20"; String sno = "10"; String expected = "200"; String actual; //Act try { objtest.Div(fno, sno); } catch (ArgumentNullException e) { // Assert StringAssert.Contains(e.Message, "AMOUNT CANNOT BE NULL"); } catch (DivideByZeroException e) { // Assert StringAssert.Contains(e.Message, "CANNOT BE DIVIDED BY ZERO"); } }
public void MulTest() { //Arrange frmUnitTest objtest = new frmUnitTest(); String fno = "20"; String sno = "10"; String expected = "200"; String actual; //Act try { objtest.Mul(fno, sno); } catch (ArgumentNullException e) { // Assert StringAssert.Contains(e.Message, "AMOUNT CANNOT BE NULL"); } }