Browse Source

5.11.24 TriangleChecker + TriangleCheckerTest mit Check Gleichseitig Methode

master
marti 2 weeks ago
parent
commit
fb5155f8b1
2 changed files with 11 additions and 1 deletions
  1. 4
    0
      Test/praktikum02/TriangleCheckerTest.java
  2. 7
    1
      src/praktikum02/TriangleChecker.java

+ 4
- 0
Test/praktikum02/TriangleCheckerTest.java View File

@@ -10,4 +10,8 @@ class TriangleCheckerTest {
void checkTriangle() {
assertEquals(TriangleChecker.TriangleType.NORMAL,TriangleChecker.checkTriangle(5, 6, 7));
}
@Test
void checkEquilateralTriangle(){
assertEquals(TriangleChecker.TriangleType.EQUILATERAL,TriangleChecker.checkTriangle(1, 1, 1));
}
}

+ 7
- 1
src/praktikum02/TriangleChecker.java View File

@@ -49,7 +49,13 @@ public class TriangleChecker {

// Analyse der Dreiecksart
public static TriangleType checkTriangle(float a, float b, float c) {
return TriangleType.NORMAL;
if(a==b && b==c){
return TriangleType.EQUILATERAL;
}
else {
return TriangleType.NORMAL;
}

}



Loading…
Cancel
Save