From 95af987307cc0d9de11bfce30cf646bc76d0fdc2 Mon Sep 17 00:00:00 2001 From: Julius Dewender Date: Sun, 31 Jan 2021 18:10:36 +0100 Subject: [PATCH] initial placement black rook a8 --- fh.fd.ci.client/src/main/java/de/fd/fh/Game.java | 2 ++ fh.fd.ci.client/src/test/java/de/fd/fh/GameTest.java | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/fh.fd.ci.client/src/main/java/de/fd/fh/Game.java b/fh.fd.ci.client/src/main/java/de/fd/fh/Game.java index 2e99b36..27d65fc 100644 --- a/fh.fd.ci.client/src/main/java/de/fd/fh/Game.java +++ b/fh.fd.ci.client/src/main/java/de/fd/fh/Game.java @@ -35,6 +35,8 @@ public class Game mField[Game.blackRowFarmer * Figure.fieldLength + j] = new FigureFarmer(FigureFarmer.Color.Black); } } + + mField[Figure.fieldLength * 0 + 0] = new FigureRook(); // schwarzer Turm a8 } boolean moveFigure(int src, int dst) 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 b77bcb5..a57f3a1 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 @@ -68,6 +68,15 @@ class GameTest } } + + @Test + void newGameInitializationFigurePositionsRooks() + { + // schwarzer Turm a8 + assertEquals(new FigureRook().getClass(), + g.mField[Figure.fieldLength * 0 + 0].getClass()); + } + @Test void moveFarmerWhite() // weißer Bauer ganz links um ein Feld noch vorne bewegen {