Repository zur Vorlesung Prog3
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 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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( 10 ,5,6) );
  8. }
  9. @Test
  10. void checkTriangleISOSCELES_AB() {
  11. assertEquals(TriangleChecker.TriangleType.ISOSCELES,TriangleChecker.checkTriangle( 10 ,10,5) );
  12. }
  13. @Test
  14. void checkTriangleISOSCELES_BC() {
  15. assertEquals(TriangleChecker.TriangleType.ISOSCELES,TriangleChecker.checkTriangle( 10 ,5,5) );
  16. }
  17. @Test
  18. void checkTriangleISOSCELES_AC() {
  19. assertEquals(TriangleChecker.TriangleType.ISOSCELES,TriangleChecker.checkTriangle( 10 ,5,10) );
  20. }
  21. @Test
  22. void checkTriangle_EQUILATERAL() {
  23. assertEquals(TriangleChecker.TriangleType.EQUILATERAL,TriangleChecker.checkTriangle( 10 ,10,10) );
  24. }
  25. @Test
  26. void checkTriangleNONE_A() {
  27. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle( 0 ,10,5) );
  28. }
  29. @Test
  30. void checkTriangleNONE_B() {
  31. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle( 10 ,0,5) );
  32. }
  33. @Test
  34. void checkTriangleNONE_C() {
  35. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle( 10 ,5,0) );
  36. }
  37. @Test
  38. void checkTriangleNONE_minusA() {
  39. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle( -2 ,10,5) );
  40. }
  41. @Test
  42. void checkTriangleNONE_minusB() {
  43. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle( 10 ,-2,5) );
  44. }
  45. @Test
  46. void checkTriangleNONE_minusC() {
  47. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle( 10 ,5,-2) );
  48. }
  49. @Test
  50. void checkTriangleNONE_AB_C() {
  51. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle( 10 ,2,13) );
  52. }
  53. @Test
  54. void checkTriangleNONE_AC_B() {
  55. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle( 10 ,13,2) );
  56. }
  57. @Test
  58. void checkTriangleNONE_BC_A() {
  59. assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle( 13 ,10,2) );
  60. }
  61. }