|
@ -38,35 +38,35 @@ class FigureTest |
|
|
@Test |
|
|
@Test |
|
|
void checkMoveWithValidDestination() |
|
|
void checkMoveWithValidDestination() |
|
|
{ |
|
|
{ |
|
|
Figure f = new Figure(); |
|
|
|
|
|
|
|
|
Figure f = new FigureFarmer(); |
|
|
assertTrue(f.moveAllowed(Figure.fieldLength * 6 + 0, Figure.fieldLength * 5 + 0, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
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 FigureFarmer(); |
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 6 + 0, Figure.fieldLength * 7 + 0, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 6 + 0, Figure.fieldLength * 7 + 0, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void whiteFarmerInvalidDestinationUp() // mehr als 1 Schritt nach "oben" |
|
|
void whiteFarmerInvalidDestinationUp() // mehr als 1 Schritt nach "oben" |
|
|
{ |
|
|
{ |
|
|
Figure f = new Figure(); |
|
|
|
|
|
|
|
|
Figure f = new FigureFarmer(); |
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 6 + 0, Figure.fieldLength * 4 + 0, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 6 + 0, Figure.fieldLength * 4 + 0, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void checkMoveWithValidDestinationVar2() // Bauer (w) steht in der Mitte vom Feld und geht 1 nach oben |
|
|
void checkMoveWithValidDestinationVar2() // Bauer (w) steht in der Mitte vom Feld und geht 1 nach oben |
|
|
{ |
|
|
{ |
|
|
Figure f = new Figure(); |
|
|
|
|
|
|
|
|
Figure f = new FigureFarmer(); |
|
|
assertTrue(f.moveAllowed(Figure.fieldLength * 4 + 4, Figure.fieldLength * 3 + 4, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
assertTrue(f.moveAllowed(Figure.fieldLength * 4 + 4, Figure.fieldLength * 3 + 4, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void whiteFarmerInvalidDestinationDownVar2() // Bauer (w) steht in der Mitte vom Feld und geht 1 nach unten |
|
|
void whiteFarmerInvalidDestinationDownVar2() // Bauer (w) steht in der Mitte vom Feld und geht 1 nach unten |
|
|
{ |
|
|
{ |
|
|
Figure f = new Figure(); |
|
|
|
|
|
|
|
|
Figure f = new FigureFarmer(); |
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 4 + 4, Figure.fieldLength * 5 + 4, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
assertFalse(f.moveAllowed(Figure.fieldLength * 4 + 4, Figure.fieldLength * 5 + 4, new int[Figure.fieldLength * Figure.fieldLength])); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |