expected to be thrown but nothing was thrown
I make a junit test for a programm and the error is that it was expection an thrown error but nothing was thrown. What could be the problem? public static double calcArea(double a, double b, double c) { checkTriangle(a, b, c); double s = (a + b + c)/2; return Math.sqrt(s * (s - a) * (s - b) * (s - c)); } private static void checkTriangle(double a, double b, double c) { // checkIfNumbersArePositive(a, b, c); //checkIfNumbersAreTooBig(a,b,c); checkRatio(a, b, c); } private static void checkRatio(double a, double b, double c) { try { if (a + b <= c) { throw new NotATriangleException("Wont form a Triangle"); } } catch(Exception e){ e.toString(); } }