Repo für das Praktikum Prog3 A
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.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 checkTriangleNormal() {
  7. assertEquals(TriangleChecker.TriangleType.NORMAL,TriangleChecker.checkTriangle(5,2.6f, 3));
  8. }
  9. @Test
  10. void checkTriangleNone(){
  11. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(6,2.9f, 2));
  12. }
  13. @Test
  14. void checkTriangleISOSCELES(){
  15. assertEquals(TriangleChecker.TriangleType.ISOSCELES,TriangleChecker.checkTriangle(6,6, 2));
  16. }
  17. @Test
  18. void checkTriangleEQUILATERAL(){
  19. assertEquals(TriangleChecker.TriangleType.EQUILATERAL,TriangleChecker.checkTriangle(6,6, 6));
  20. }
  21. @Test
  22. void checkTriangleANegativ(){
  23. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(-6,6, 6));
  24. }
  25. @Test
  26. void checkTriangleBNegativ(){
  27. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(6,-6, 6));
  28. }
  29. @Test
  30. void checkTriangleCNegativ(){
  31. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(6,6, -6));
  32. }
  33. @Test
  34. void checkTriangleAToLong(){
  35. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(36,6, 6));
  36. }
  37. @Test
  38. void checkTriangleBToLong(){
  39. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(6,46, 6));
  40. }
  41. @Test
  42. void checkTriangleCToLong(){
  43. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(6,6, 56));
  44. }
  45. }