You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
967 B

package de.fd.fh;
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.*;
class GameTest
{
@Test
void newGameInitializationCorrectField()
{
Game g = new Game();
g.initNewGame();
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);
}
}