-> Test jetzt für alle Fälle positivmaster
@@ -50,6 +50,10 @@ public class TriangleChecker { | |||
if (a+b>c || b+c>a || a+c>b) { | |||
if (a==b && b==c) { | |||
return TriangleType.EQUILATERAL; | |||
} | |||
if (a == b || a == c || b == c) { | |||
return TriangleType.ISOSCELES; | |||
} |
@@ -9,13 +9,13 @@ public class TriangleCheckerTest { | |||
// Arrange | |||
float a = 2; | |||
float b = 2; | |||
float c = 4; | |||
float c = 2; | |||
// Act | |||
TriangleChecker.TriangleType type = TriangleChecker.checkTriangle(a, b, c); | |||
// Assert | |||
assertEquals(TriangleChecker.TriangleType.ISOSCELES, type); | |||
assertEquals(TriangleChecker.TriangleType.EQUILATERAL, type); | |||
} | |||