From 64b3f88e935cf1ba1bf3506787b57e48f2b6e832 Mon Sep 17 00:00:00 2001 From: Malte Schellhardt Date: Thu, 10 Feb 2022 23:20:19 +0100 Subject: [PATCH] tictactoe: refactored test case and added cases to check draw --- .../java/de/tims/tictactoe/GameLogicTest.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/test/java/de/tims/tictactoe/GameLogicTest.java b/src/test/java/de/tims/tictactoe/GameLogicTest.java index a66e9d4..30ab928 100644 --- a/src/test/java/de/tims/tictactoe/GameLogicTest.java +++ b/src/test/java/de/tims/tictactoe/GameLogicTest.java @@ -150,10 +150,6 @@ class GameLogicTest { {{'o', '-', '-'}, {'o', '-', '-'}, {'o', '-', '-'}}), - Arguments.of("check win in column 0 for player 2", 'o', false, new char[][] - {{'o', '-', '-'}, - {'o', '-', '-'}, - {'-', '-', '-'}}), Arguments.of("check win in row 0 for player 1", 'x', true, new char[][] {{'x', 'x', 'x'}, {'-', '-', '-'}, @@ -193,7 +189,19 @@ class GameLogicTest { Arguments.of("check win in row 2 for player 2 with full board", 'o', true, new char[][] {{'x', 'x', 'o'}, {'o', 'x', 'x'}, - {'o', 'o', 'o'}}) + {'o', 'o', 'o'}}), + Arguments.of("check win in column 0 for player 2", 'o', false, new char[][] + {{'o', '-', '-'}, + {'o', '-', '-'}, + {'-', '-', '-'}}), + Arguments.of("check a draw for player 2", 'o', false, new char[][] + {{'o', 'o', 'x'}, + {'o', 'o', 'x'}, + {'x', 'x', 'o'}}), + Arguments.of("check a draw for player 1", 'x', false, new char[][] + {{'o', 'o', 'x'}, + {'o', 'o', 'x'}, + {'x', 'x', 'o'}}) ); }