diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..797acea --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/gruppe06-hufflepuff-projekt1-tic-tac-toe.iml b/gruppe06-hufflepuff-projekt1-tic-tac-toe.iml index c5e5271..8d22ed4 100644 --- a/gruppe06-hufflepuff-projekt1-tic-tac-toe.iml +++ b/gruppe06-hufflepuff-projekt1-tic-tac-toe.iml @@ -60,5 +60,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Game.java b/src/Game.java index 6718540..f61e715 100644 --- a/src/Game.java +++ b/src/Game.java @@ -11,8 +11,8 @@ public class Game { private Gamefield gamefield; private Language language; - private int player1 = 1; - private int player2 = 2; + private final int player1 = 1; + private final int player2 = 2; private int playerPlaying = 1; // @@ -52,6 +52,7 @@ public class Game { language.outputWinnerText(playerPlaying); gameFinished = true; } else if (checkForTie()) { + language.outputTieText(); language.outputGameOverText(); gameFinished = true; } diff --git a/src/Language.java b/src/Language.java index a67b607..abd416b 100644 --- a/src/Language.java +++ b/src/Language.java @@ -63,7 +63,7 @@ public class Language { /** * Methode: outputMove - * Diese Methode gibt die Anzahl Spielzüge aus, die im Spiel bereits gemacht worden sind, und + * Diese Methode gibt die Anzahl Spielzüge aus, die im Spiel bereits gemacht worden sind und * welcher Spieler den Zug macht */ public void outputMoveText(int move, int player) { diff --git a/test/GameTest.java b/test/GameTest.java index 06b61e5..ca7c122 100644 --- a/test/GameTest.java +++ b/test/GameTest.java @@ -1,4 +1,3 @@ -import org.junit.Assert; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -6,6 +5,8 @@ import org.junit.jupiter.api.Test; import java.io.ByteArrayOutputStream; import java.io.PrintStream; +import static org.junit.jupiter.api.Assertions.assertEquals; + /** * Klasse GameTest * @@ -67,7 +68,7 @@ class GameTest { System.out.println("Hello Baeldung Readers!!"); System.out.println("Hello Baeldung Readers!!"); - Assert.assertEquals("Hello Baeldung Readers!!\n" + + assertEquals("Hello Baeldung Readers!!\n" + "Hello Baeldung Readers!!\n" + "Hello Baeldung Readers!!\n" + "Hello Baeldung Readers!!", outputStreamCaptor.toString() diff --git a/test/GamefieldTest.java b/test/GamefieldTest.java index 0899170..ea1858d 100644 --- a/test/GamefieldTest.java +++ b/test/GamefieldTest.java @@ -1,4 +1,3 @@ -import org.junit.Before; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; @@ -32,5 +31,6 @@ class GamefieldTest { @Test void outputField() { + gamefield.outputField(); } } \ No newline at end of file