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 778B

1234567891011121314151617181920212223242526272829303132
  1. import org.junit.Test;
  2. import static org.junit.Assert.*;
  3. public class TriangleCheckerTest {
  4. @Test
  5. public void testValidTriangle() {
  6. // Arrange
  7. float a = 2;
  8. float b = 3;
  9. float c = 4;
  10. float d = 12;
  11. float e = 32;
  12. float f = 7;
  13. float h = 11;
  14. float g = 41;
  15. float i = 4;
  16. // Assert
  17. assertTrue(TriangleChecker.checkTriangleType(a, b, c));
  18. assertFalse(TriangleChecker.checkTriangleType(a, d, c));
  19. assertTrue(TriangleChecker.checkTriangleType(e, d, e));
  20. assertFalse(TriangleChecker.checkTriangleType(a, f, h));
  21. assertFalse(TriangleChecker.checkTriangleType(i, c, d));
  22. assertFalse(TriangleChecker.checkTriangleType(g, i, d));
  23. }
  24. }