|
@ -15,4 +15,24 @@ class GameTest |
|
|
|
|
|
|
|
|
assertEquals(Figure.fieldLength * Figure.fieldLength, g.mField.length); |
|
|
assertEquals(Figure.fieldLength * Figure.fieldLength, g.mField.length); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// prüft, ob Figuren nach Initialisierung nur an vorgesehenden Positionen stehen |
|
|
|
|
|
@Test |
|
|
|
|
|
void newGameInitializationFigurePositions() |
|
|
|
|
|
{ |
|
|
|
|
|
Game g = new Game(); |
|
|
|
|
|
g.initNewGame(); |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 8; i++) // row |
|
|
|
|
|
{ |
|
|
|
|
|
if (i == 0 || i == 1 || i == 6 || i == 7) |
|
|
|
|
|
{ |
|
|
|
|
|
for (int j = 0; j < 8; j++) // col |
|
|
|
|
|
{ |
|
|
|
|
|
assertNotEquals(null, g.mField[i * 8 + j]); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
assertEquals(Figure.fieldLength * Figure.fieldLength, g.mField.length); |
|
|
|
|
|
} |
|
|
} |
|
|
} |