12345678910111213141516171819202122232425262728293031323334353637 |
- package praktikum1;
-
- import org.junit.jupiter.api.Test;
-
- import static org.junit.jupiter.api.Assertions.*;
-
- class TriangleCheckerTest {
-
- @Test
- void checkEquilateralTriangle() {
- //Gleichseitig
- assertEquals(TriangleChecker.TriangleType.EQUILATERAL,TriangleChecker.checkTriangle(5,5,5));
- }
- @Test
- void checkIsoscelesTriangle(){
- //Gleichschenklich
- assertEquals(TriangleChecker.TriangleType.ISOSCELES, TriangleChecker.checkTriangle(5,5,3));
- assertEquals(TriangleChecker.TriangleType.ISOSCELES, TriangleChecker.checkTriangle(3,5,5));
- assertEquals(TriangleChecker.TriangleType.ISOSCELES, TriangleChecker.checkTriangle(5,3,5));
- }
-
- @Test
- void checkNormalTrianlge(){
- assertEquals(TriangleChecker.TriangleType.NORMAL,TriangleChecker.checkTriangle(3,5,7));
- }
- @Test
- void chechNoneTrianlge(){
- assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(100,10,1));
- assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(10,100,1));
- assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(1,10,100));
- assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(-2,2,3));
- assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(2,-2,3));
- assertEquals(TriangleChecker.TriangleType.NONE,TriangleChecker.checkTriangle(2,2,-3));
-
-
- }
- }
|