public void TestDivideWithDivideByZeroException() { ExceptionHandlingCase exceptionHandlingCase = new ExceptionHandlingCase(); int numerator = 4; int denominator = 0; int actualResult; actualResult = exceptionHandlingCase.Divide(numerator, denominator); }
public void TestDivide() { try { ExceptionHandlingCase exceptionHandlingCase = new ExceptionHandlingCase(); int numerator = 4; int denominator = 0; int actualResult; //Act actualResult = exceptionHandlingCase.Divide(numerator, denominator); // this will throw DivideByZeroException } catch (Exception e) { //Assert throw new AssertFailedException(e.Message, e); } }