|
@ -10,41 +10,41 @@ class FigureTest |
|
|
void checkMoveWithInvalidFieldSmall() // Feldgröße sollte 8*8 betragen |
|
|
void checkMoveWithInvalidFieldSmall() // Feldgröße sollte 8*8 betragen |
|
|
{ |
|
|
{ |
|
|
Figure f = new Figure(); |
|
|
Figure f = new Figure(); |
|
|
assertFalse(f.moveAllowed(0,0, new int[0])); |
|
|
|
|
|
|
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 6 + 0, Figure.fieldLength * 5 + 0, new int[0])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void checkMoveWithInvalidFieldBigger() // Feldgröße sollte 8*8 betragen |
|
|
void checkMoveWithInvalidFieldBigger() // Feldgröße sollte 8*8 betragen |
|
|
{ |
|
|
{ |
|
|
Figure f = new Figure(); |
|
|
Figure f = new Figure(); |
|
|
assertFalse(f.moveAllowed(48,40, new int[8*9])); |
|
|
|
|
|
|
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 6 + 0, Figure.fieldLength * 5 + 0, new int[8*9])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void checkMoveWithInvalidFieldCorrect() // Feldgröße sollte 8*8 betragen |
|
|
void checkMoveWithInvalidFieldCorrect() // Feldgröße sollte 8*8 betragen |
|
|
{ |
|
|
{ |
|
|
Figure f = new Figure(); |
|
|
Figure f = new Figure(); |
|
|
assertTrue(f.moveAllowed(48,40, new int[Figure.fieldSize])); |
|
|
|
|
|
|
|
|
assertTrue(f.moveAllowed(Figure.fieldLength * 6 + 0, Figure.fieldLength * 5 + 0, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void checkMoveWithoutNewDestination() |
|
|
void checkMoveWithoutNewDestination() |
|
|
{ |
|
|
{ |
|
|
Figure f = new Figure(); |
|
|
Figure f = new Figure(); |
|
|
assertFalse(f.moveAllowed(48,48, new int[Figure.fieldSize])); |
|
|
|
|
|
|
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 6 + 0, Figure.fieldLength * 6 + 0, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void checkMoveWithValidDestination() |
|
|
void checkMoveWithValidDestination() |
|
|
{ |
|
|
{ |
|
|
Figure f = new Figure(); |
|
|
Figure f = new Figure(); |
|
|
assertTrue(f.moveAllowed(48,40, new int[Figure.fieldSize])); |
|
|
|
|
|
|
|
|
assertTrue(f.moveAllowed(Figure.fieldLength * 6 + 0, Figure.fieldLength * 5 + 0, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void whiteFarmerInvalidDestinationDown() // statt nach "oben" wird nach "unten" gegangen |
|
|
void whiteFarmerInvalidDestinationDown() // statt nach "oben" wird nach "unten" gegangen |
|
|
{ |
|
|
{ |
|
|
Figure f = new Figure(); |
|
|
Figure f = new Figure(); |
|
|
assertFalse(f.moveAllowed(48,56, new int[Figure.fieldSize])); |
|
|
|
|
|
|
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 6 + 0, Figure.fieldLength * 7 + 0, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |