|
|
@@ -19,4 +19,46 @@ public class TriangleCheckerTest { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testEquilateralTriangle(){ |
|
|
|
// Arrange |
|
|
|
float a = 3; |
|
|
|
float b = 3; |
|
|
|
float c = 3; |
|
|
|
|
|
|
|
// Act |
|
|
|
TriangleChecker.TriangleType type = TriangleChecker.checkTriangle(a, b, c); |
|
|
|
|
|
|
|
// Assert |
|
|
|
assertEquals(TriangleChecker.TriangleType.EQUILATERAL, type); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testNoTriangle(){ |
|
|
|
// Arrange |
|
|
|
float a = 1; |
|
|
|
float b = 100; |
|
|
|
float c = 1; |
|
|
|
|
|
|
|
// Act |
|
|
|
TriangleChecker.TriangleType type = TriangleChecker.checkTriangle(a, b, c); |
|
|
|
|
|
|
|
// Assert |
|
|
|
assertEquals(TriangleChecker.TriangleType.NONE, type); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testIsocelesTriangle(){ |
|
|
|
// Arrange |
|
|
|
float a = 3; |
|
|
|
float b = 3; |
|
|
|
float c = 4; |
|
|
|
|
|
|
|
// Act |
|
|
|
TriangleChecker.TriangleType type = TriangleChecker.checkTriangle(a, b, c); |
|
|
|
|
|
|
|
// Assert |
|
|
|
assertEquals(TriangleChecker.TriangleType.ISOSCELES, type); |
|
|
|
} |
|
|
|
|
|
|
|
} |