|
|
@ -66,4 +66,24 @@ class GameTest |
|
|
|
g.mField[Game.blackRowFarmer * Figure.fieldLength + j]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void moveFarmerWhite() // weißer Bauer ganz links um ein Feld noch vorne bewegen |
|
|
|
{ |
|
|
|
Game g = new Game(); |
|
|
|
g.initNewGame(); |
|
|
|
|
|
|
|
// zu bewegende Figur |
|
|
|
Figure f = g.mField[Game.whiteRowFarmer * 8 + 0]; |
|
|
|
|
|
|
|
// Ziel sollte leer sein |
|
|
|
assertNull(g.mField[(Game.whiteRowFarmer - 1) * 8 + 0]); |
|
|
|
|
|
|
|
// Figur bewegen |
|
|
|
assertTrue(g.moveFigure(Game.whiteRowFarmer * 8 + 0, (Game.whiteRowFarmer - 1) * 8 + 0)); |
|
|
|
|
|
|
|
// Figur sollte nun verschoben sein |
|
|
|
assertNull(g.mField[Game.whiteRowFarmer * 8 + 0]); |
|
|
|
assertSame(f, g.mField[(Game.whiteRowFarmer - 1) * 8 + 0]); |
|
|
|
} |
|
|
|
} |