Magdalena, Luca-Marie, Melanie
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TriangleCheckerTest.java 1.4KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package praktikum1;
  2. import org.junit.jupiter.api.Test;
  3. import static org.junit.jupiter.api.Assertions.*;
  4. class TriangleCheckerTest {
  5. @Test
  6. void checkEquilateralTriangle() {
  7. //Gleichseitig
  8. assertEquals(TriangleChecker.TriangleType.EQUILATERAL,TriangleChecker.checkTriangle(5,5,5));
  9. }
  10. @Test
  11. void checkIsoscelesTriangle(){
  12. //Gleichschenklich
  13. assertEquals(TriangleChecker.TriangleType.ISOSCELES, TriangleChecker.checkTriangle(5,5,3));
  14. assertEquals(TriangleChecker.TriangleType.ISOSCELES, TriangleChecker.checkTriangle(3,5,5));
  15. assertEquals(TriangleChecker.TriangleType.ISOSCELES, TriangleChecker.checkTriangle(5,3,5));
  16. }
  17. @Test
  18. void checkNormalTrianlge(){
  19. assertEquals(TriangleChecker.TriangleType.NORMAL,TriangleChecker.checkTriangle(3,5,7));
  20. }
  21. @Test
  22. void chechNoneTrianlge(){
  23. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(100,10,1));
  24. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(10,100,1));
  25. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(1,10,100));
  26. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(-2,2,3));
  27. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(2,-2,3));
  28. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(2,2,-3));
  29. }
  30. }