Repository zu 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 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import org.junit.jupiter.api.Test;
  2. import static org.junit.jupiter.api.Assertions.*;
  3. class TriangleCheckerTest {
  4. @Test
  5. public void testNegativeSide() {
  6. assertEquals(TriangleChecker.TriangleType.NONE, TriangleChecker.checkTriangle(-1, 2, 3));
  7. }
  8. @Test
  9. public void testTwoNegativeSides() {
  10. assertEquals(TriangleChecker.TriangleType.NONE, TriangleChecker.checkTriangle(-1, -2, 3));
  11. }
  12. @Test
  13. public void testAllNegativeSides() {
  14. assertEquals(TriangleChecker.TriangleType.NONE, TriangleChecker.checkTriangle(-1, -2, -3));
  15. }
  16. @Test
  17. public void testOneZeroSide() {
  18. assertEquals(TriangleChecker.TriangleType.NONE, TriangleChecker.checkTriangle(0, 3, 4));
  19. }
  20. @Test
  21. public void testTwoZeroSides() {
  22. assertEquals(TriangleChecker.TriangleType.NONE, TriangleChecker.checkTriangle(0, 0, 5));
  23. }
  24. @Test
  25. public void testOneOversizedSide() {
  26. assertEquals(TriangleChecker.TriangleType.NONE, TriangleChecker.checkTriangle(10, 2, 3));
  27. }
  28. @Test
  29. public void testEquilateralTriangle() {
  30. assertEquals(TriangleChecker.TriangleType.EQUILATERAL, TriangleChecker.checkTriangle(5, 5, 5));
  31. }
  32. @Test
  33. public void testIsoscelesTriangle() {
  34. assertEquals(TriangleChecker.TriangleType.ISOSCELES, TriangleChecker.checkTriangle(5, 5, 3));
  35. }
  36. }