From 068bed8357c9eca954f32ce1772ae80273cff624 Mon Sep 17 00:00:00 2001 From: Malte Schellhardt Date: Sun, 30 Jan 2022 13:53:21 +0100 Subject: [PATCH] tictactoe: added method to count playing fields --- src/main/java/de/tims/tictactoe/GameLogic.java | 5 +++++ src/test/java/de/tims/tictactoe/GameLogicTest.java | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/main/java/de/tims/tictactoe/GameLogic.java b/src/main/java/de/tims/tictactoe/GameLogic.java index 4e0c81a..07e2998 100644 --- a/src/main/java/de/tims/tictactoe/GameLogic.java +++ b/src/main/java/de/tims/tictactoe/GameLogic.java @@ -8,4 +8,9 @@ public class GameLogic { return this.board; } + public int countFields() { + // TODO Auto-generated method stub + return 9; + } + } diff --git a/src/test/java/de/tims/tictactoe/GameLogicTest.java b/src/test/java/de/tims/tictactoe/GameLogicTest.java index ecfafb9..ac43308 100644 --- a/src/test/java/de/tims/tictactoe/GameLogicTest.java +++ b/src/test/java/de/tims/tictactoe/GameLogicTest.java @@ -33,5 +33,13 @@ class GameLogicTest { assertArrayEquals(expectedResult, realResult); } + + @Test + void fieldCountTest() { + int expectedResult = 9; + int realResult = game.countFields(); + + assertEquals(expectedResult, realResult); + } }