|
|
@@ -10,12 +10,22 @@ public class TriangleCheckerTest { |
|
|
|
float a = 2; |
|
|
|
float b = 3; |
|
|
|
float c = 4; |
|
|
|
float d = 12; |
|
|
|
float e = 32; |
|
|
|
float f = 7; |
|
|
|
float h = 11; |
|
|
|
float g = 41; |
|
|
|
float i = 4; |
|
|
|
|
|
|
|
// Act |
|
|
|
TriangleChecker.TriangleType type = TriangleChecker.checkTriangle(a, b, c); |
|
|
|
|
|
|
|
// Assert |
|
|
|
assertEquals(TriangleChecker.TriangleType.NORMAL, type); |
|
|
|
assertTrue(TriangleChecker.checkTriangleType(a, b, c)); |
|
|
|
assertFalse(TriangleChecker.checkTriangleType(a, d, c)); |
|
|
|
assertTrue(TriangleChecker.checkTriangleType(e, d, e)); |
|
|
|
assertFalse(TriangleChecker.checkTriangleType(a, f, h)); |
|
|
|
assertFalse(TriangleChecker.checkTriangleType(i, c, d)); |
|
|
|
assertFalse(TriangleChecker.checkTriangleType(g, i, d)); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|