|
|
@ -1,5 +1,7 @@ |
|
|
|
package de.fd.fh; |
|
|
|
|
|
|
|
import org.junit.jupiter.api.BeforeAll; |
|
|
|
import org.junit.jupiter.api.BeforeEach; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
|
|
|
import static org.hamcrest.MatcherAssert.assertThat; |
|
|
@ -7,12 +9,17 @@ import static org.junit.jupiter.api.Assertions.*; |
|
|
|
|
|
|
|
class GameTest |
|
|
|
{ |
|
|
|
@Test |
|
|
|
void newGameInitializationCorrectField() |
|
|
|
private Game g = new Game(); |
|
|
|
|
|
|
|
@BeforeEach |
|
|
|
void setupTest() |
|
|
|
{ |
|
|
|
Game g = new Game(); |
|
|
|
g.initNewGame(); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void newGameInitializationCorrectField() |
|
|
|
{ |
|
|
|
assertEquals(Figure.fieldLength * Figure.fieldLength, g.mField.length); |
|
|
|
} |
|
|
|
|
|
|
@ -20,9 +27,6 @@ class GameTest |
|
|
|
@Test |
|
|
|
void newGameInitializationFigurePositions() |
|
|
|
{ |
|
|
|
Game g = new Game(); |
|
|
|
g.initNewGame(); |
|
|
|
|
|
|
|
for (int i = 0; i < Figure.fieldLength; i++) // row |
|
|
|
{ |
|
|
|
for (int j = 0; j < Figure.fieldLength; j++) // col |
|
|
@ -45,9 +49,6 @@ class GameTest |
|
|
|
@Test |
|
|
|
void newGameInitializationFigurePositionsFarmer() |
|
|
|
{ |
|
|
|
Game g = new Game(); |
|
|
|
g.initNewGame(); |
|
|
|
|
|
|
|
// weiße Bauern |
|
|
|
for (int j = 0; j < Figure.fieldLength; j++) // col |
|
|
|
{ |
|
|
@ -70,9 +71,6 @@ class GameTest |
|
|
|
@Test |
|
|
|
void moveFarmerWhite() // weißer Bauer ganz links um ein Feld noch vorne bewegen |
|
|
|
{ |
|
|
|
Game g = new Game(); |
|
|
|
g.initNewGame(); |
|
|
|
|
|
|
|
int src = Game.whiteRowFarmer * Figure.fieldLength + 0; |
|
|
|
int dst = (Game.whiteRowFarmer - 1) * Figure.fieldLength + 0; |
|
|
|
|
|
|
|