From f94a0a627017aee5b0b5057a41d4b78f38cf4294 Mon Sep 17 00:00:00 2001 From: fdai7892 Date: Wed, 7 Feb 2024 21:08:58 +0100 Subject: [PATCH] Aktuellen Spieler ausgeben --- src/test/test_duellist_spielesammlung_projekt.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/test_duellist_spielesammlung_projekt.c b/src/test/test_duellist_spielesammlung_projekt.c index 53d2e0d..89df4de 100644 --- a/src/test/test_duellist_spielesammlung_projekt.c +++ b/src/test/test_duellist_spielesammlung_projekt.c @@ -186,6 +186,20 @@ void test_BoardFull_returns_true_when_board_is_full(void) { // Assert TEST_ASSERT_TRUE(boardFull); } +void test_getCurrentPlayer_returns_correct_player(void) { + // Arrange + TicTacToeGame game = { .board = {{PLAYER_X, EMPTY, EMPTY}, + {EMPTY, PLAYER_O, EMPTY}, + {EMPTY, EMPTY, EMPTY}}, + .currentPlayer = PLAYER_O }; + + // Act + Player currentPlayer = getCurrentPlayer(&game); + + // Assert + TEST_ASSERT_EQUAL(PLAYER_O, currentPlayer); +} +