From 3de907b77e91c0d07357df707b664e6493fbcd86 Mon Sep 17 00:00:00 2001 From: Julius Dewender Date: Sun, 31 Jan 2021 11:41:47 +0100 Subject: [PATCH] initial creation of "Game" class --- .../src/main/java/de/fd/fh/Game.java | 11 +++++++++++ .../src/test/java/de/fd/fh/GameTest.java | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 fh.fd.ci.client/src/main/java/de/fd/fh/Game.java create mode 100644 fh.fd.ci.client/src/test/java/de/fd/fh/GameTest.java 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 new file mode 100644 index 0000000..5aa4ad8 --- /dev/null +++ b/fh.fd.ci.client/src/main/java/de/fd/fh/Game.java @@ -0,0 +1,11 @@ +package de.fd.fh; + +public class Game +{ + public Figure[] mField; + + public void initNewGame() + { + mField = new Figure[64]; + } +} 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 new file mode 100644 index 0000000..49e8668 --- /dev/null +++ b/fh.fd.ci.client/src/test/java/de/fd/fh/GameTest.java @@ -0,0 +1,18 @@ +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); + } +} \ No newline at end of file