diff --git a/fh.fd.ci.client/src/test/java/de/fd/fh/GameTest.java b/fh.fd.ci.client/src/test/java/de/fd/fh/GameTest.java index 241db7b..271ffdb 100644 --- a/fh.fd.ci.client/src/test/java/de/fd/fh/GameTest.java +++ b/fh.fd.ci.client/src/test/java/de/fd/fh/GameTest.java @@ -73,17 +73,20 @@ class GameTest Game g = new Game(); g.initNewGame(); + int src = Game.whiteRowFarmer * Figure.fieldLength + 0; + int dst = (Game.whiteRowFarmer - 1) * Figure.fieldLength + 0; + // zu bewegende Figur - Figure f = g.mField[Game.whiteRowFarmer * 8 + 0]; + Figure f = g.mField[src]; // Ziel sollte leer sein - assertNull(g.mField[(Game.whiteRowFarmer - 1) * 8 + 0]); + assertNull(g.mField[dst]); // Figur bewegen - assertTrue(g.moveFigure(Game.whiteRowFarmer * 8 + 0, (Game.whiteRowFarmer - 1) * 8 + 0)); + assertTrue(g.moveFigure(src, dst)); // Figur sollte nun verschoben sein - assertNull(g.mField[Game.whiteRowFarmer * 8 + 0]); - assertSame(f, g.mField[(Game.whiteRowFarmer - 1) * 8 + 0]); + assertNull(g.mField[src]); + assertSame(f, g.mField[dst]); } } \ No newline at end of file