@@ -49,7 +49,12 @@ public class TriangleChecker { | |||
// Analyse der Dreiecksart | |||
public static TriangleType checkTriangle(float a, float b, float c) { | |||
return TriangleType.NORMAL; | |||
if(a==b && a==c){ | |||
return TriangleType.EQUILATERAL; | |||
} | |||
else{ | |||
return TriangleType.NORMAL; | |||
} | |||
} | |||
@@ -8,6 +8,11 @@ class TriangleCheckerTest { | |||
@Test | |||
void checkTriangle() { | |||
assertEquals(TriangleChecker.TriangleType.NORMAL,TriangleChecker.checkTriangle(5,6,7)); | |||
assertEquals(TriangleChecker.TriangleType.NORMAL, TriangleChecker.checkTriangle(5, 6, 7)); | |||
} | |||
@Test | |||
void checkGleichseitig() { | |||
assertEquals(TriangleChecker.TriangleType.EQUILATERAL, TriangleChecker.checkTriangle(1,1,1)); | |||
} | |||
} |