|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- package Praktikum03;
-
- import org.junit.jupiter.api.Test;
-
- import static org.junit.jupiter.api.Assertions.*;
-
- class TriangleCheckerTest {
-
-
- @Test
- void checkNormalTriangle() {
-
- float a = 3.0f;
- float b = 4.0f;
- float c = 2.0f;
-
- TriangleChecker.TriangleType type = TriangleChecker.checkTriangle(a,b,c);
-
- assertEquals(TriangleChecker.TriangleType.NORMAL, type);
-
- }
-
- @Test
- void checkEquilateralTriangle() {
-
- float a = 3.0f;
-
-
- TriangleChecker.TriangleType type = TriangleChecker.checkTriangle(a,a,a);
-
- assertEquals(TriangleChecker.TriangleType.EQUILATERAL, type);
-
- }
-
- @Test
- void checkIsoscelesTriangle() {
-
- float a = 3.0f;
- float b = 4.0f;
-
-
- TriangleChecker.TriangleType type = TriangleChecker.checkTriangle(a,b,a);
-
- assertEquals(TriangleChecker.TriangleType.ISOSCELES, type);
-
- }
-
- @Test
- void checkNumbersNegative(){
- float a = 5.0f;
- float b = -20.0f;
- float c = 4.0f;
-
- TriangleChecker.TriangleType type = TriangleChecker.checkTriangle(a,b,c);
-
- assertEquals(TriangleChecker.TriangleType.NONE, type);
- }
-
- @Test
- void checkIfSideToLong(){
- float a = 3.0f;
- float b = 20.0f;
- float c = 5.0f;
-
- TriangleChecker.TriangleType type = TriangleChecker.checkTriangle(a,b,c);
-
- assertEquals(TriangleChecker.TriangleType.NONE, type);
- }
-
- }
|