From 378b499b1c0f64fa6e65ad6bb90d0f9bf45c1ddd Mon Sep 17 00:00:00 2001 From: fdai7892 Date: Wed, 7 Feb 2024 20:29:43 +0100 Subject: [PATCH] =?UTF-8?q?Unittest:=20G=C3=BCltige?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/test_duellist_spielesammlung_projekt.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/test_duellist_spielesammlung_projekt.c b/src/test/test_duellist_spielesammlung_projekt.c index b990cfe..9af7c6d 100644 --- a/src/test/test_duellist_spielesammlung_projekt.c +++ b/src/test/test_duellist_spielesammlung_projekt.c @@ -89,6 +89,19 @@ void test_valid_move_and_switch_player(void) { } +void test_invalid_input(void) { + // Arrange + TicTacToeGame game = { .board = {{PLAYER_X, EMPTY, EMPTY}, + {EMPTY, EMPTY, EMPTY}, + {EMPTY, EMPTY, EMPTY}}, + .currentPlayer = PLAYER_O }; + + // Act + GameResult result = makeMove(&game, 0, 0); + + // Assert + TEST_ASSERT_EQUAL(INVALID_MOVE, result); +}