|
|
@@ -80,4 +80,54 @@ public class TriangleCheckerTest { |
|
|
|
assertEquals(TriangleChecker.TriangleType.NONE, type); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testValidNoTriangle4() { |
|
|
|
|
|
|
|
// Arrange |
|
|
|
float a = -1; |
|
|
|
float b = -1; |
|
|
|
float c = -1; |
|
|
|
|
|
|
|
// Act |
|
|
|
TriangleChecker.TriangleType type = TriangleChecker.checkTriangle(a, b, c); |
|
|
|
|
|
|
|
// Assert |
|
|
|
assertEquals(TriangleChecker.TriangleType.NONE, type); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testValidIsoscelesTriangle() { |
|
|
|
|
|
|
|
// 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); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testValidNoTriangle5() { |
|
|
|
|
|
|
|
// Arrange |
|
|
|
float a = 4; |
|
|
|
float b = 4; |
|
|
|
float c = 13; |
|
|
|
|
|
|
|
// Act |
|
|
|
TriangleChecker.TriangleType type = TriangleChecker.checkTriangle(a, b, c); |
|
|
|
|
|
|
|
// Assert |
|
|
|
assertEquals(TriangleChecker.TriangleType.NONE, type); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |