Ad
  • Default User Avatar

    Division by zero should raise an error. In C# when I use a try catch statement, I get

    Expected: < System.DivideByZeroException >
    But was: null

    example:
    try
    {
    a / b; // b is 0
    }
    catch(DivideByZeroException e)
    {
    return e.ToString();
    }

    Test is not passed when doing it this way. Why? :)