@@ -49,8 +49,12 @@ public class TriangleChecker { | |||
public static TriangleType checkTriangle(float a, float b, float c) { | |||
if (a+b>c || b+c>a || a+c>b) { | |||
if (a == b || a == c || b == c) { | |||
return TriangleType.ISOSCELES; | |||
} | |||
return TriangleType.NORMAL; | |||
} | |||
return TriangleType.NONE; | |||
return TriangleType.NONE; | |||
} | |||
} |
@@ -8,14 +8,14 @@ public class TriangleCheckerTest { | |||
// Arrange | |||
float a = 2; | |||
float b = 3; | |||
float b = 2; | |||
float c = 4; | |||
// Act | |||
TriangleChecker.TriangleType type = TriangleChecker.checkTriangle(a, b, c); | |||
// Assert | |||
assertEquals(TriangleChecker.TriangleType.NORMAL, type); | |||
assertEquals(TriangleChecker.TriangleType.ISOSCELES, type); | |||
} | |||