@@ -51,10 +51,13 @@ public class TriangleChecker { | |||
public static TriangleType checkTriangle(float a, float b, float c) { | |||
if(a + b > c && a + c > b && b + c > a){ | |||
if (a == b || b == c || a == c){ | |||
return TriangleType.ISOSCELES; | |||
} | |||
return TriangleType.NORMAL; | |||
} else { | |||
return TriangleType.NONE; | |||
} | |||
return TriangleType.NONE; | |||
} |
@@ -15,4 +15,9 @@ class TriangleCheckerTest { | |||
void checkTriangleNone(){ | |||
assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(6,2.9f, 2)); | |||
} | |||
@Test | |||
void checkTriangleISOSCELES(){ | |||
assertEquals(TriangleChecker.TriangleType.ISOSCELES,TriangleChecker.checkTriangle(6,6, 2)); | |||
} | |||
} |