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.2KB

12345678910111213141516171819202122232425262728293031323334
  1. package praktikum02;
  2. import org.junit.jupiter.api.Test;
  3. import static org.junit.jupiter.api.Assertions.*;
  4. class TriangleCheckerTest {
  5. @Test
  6. void checkTriangle() {
  7. assertEquals(TriangleChecker.TriangleType.NORMAL,TriangleChecker.checkTriangle(5, 6, 7));
  8. }
  9. @Test
  10. void checkEquilateralTriangle(){
  11. assertEquals(TriangleChecker.TriangleType.EQUILATERAL,TriangleChecker.checkTriangle(1, 1, 1));
  12. }
  13. @Test
  14. void checkIsocelesTriangle(){
  15. assertEquals(TriangleChecker.TriangleType.ISOSCELES,TriangleChecker.checkTriangle(5, 5, 1));
  16. }
  17. @Test
  18. void checkNegativ() {
  19. assertEquals(TriangleChecker.TriangleType.NONE, TriangleChecker.checkTriangle(-1, 3, 5));
  20. assertEquals(TriangleChecker.TriangleType.NONE, TriangleChecker.checkTriangle(3, 0, 5));
  21. assertEquals(TriangleChecker.TriangleType.NONE, TriangleChecker.checkTriangle(3, 5, -10));
  22. }
  23. @Test
  24. void checkLength() {
  25. assertEquals(TriangleChecker.TriangleType.NONE, TriangleChecker.checkTriangle(20, 3, 5));
  26. assertEquals(TriangleChecker.TriangleType.NONE, TriangleChecker.checkTriangle(10, 20, 10));
  27. assertEquals(TriangleChecker.TriangleType.NONE, TriangleChecker.checkTriangle(1, 1, 60));
  28. }
  29. }