diff --git a/src/test/test_duellist_spielesammlung_projekt.c b/src/test/test_duellist_spielesammlung_projekt.c index c74dc9e..b990cfe 100644 --- a/src/test/test_duellist_spielesammlung_projekt.c +++ b/src/test/test_duellist_spielesammlung_projekt.c @@ -73,7 +73,20 @@ void test_diagonal_win(void) { TEST_ASSERT_EQUAL(GAME_WIN, result); } +void test_valid_move_and_switch_player(void) { + // Arrange + TicTacToeGame game = { .board = {{EMPTY, EMPTY, EMPTY}, + {EMPTY, EMPTY, EMPTY}, + {EMPTY, EMPTY, EMPTY}}, + .currentPlayer = PLAYER_X }; + // Act + GameResult moveResult = makeMove(&game, 1, 1); + + // Assert + TEST_ASSERT_EQUAL(SUCCESS, moveResult); + TEST_ASSERT_EQUAL(PLAYER_O, game.currentPlayer); +}