Browse Source

Aktuellen Spieler ausgeben

remotes/origin/homan
fdai7892 11 months ago
parent
commit
f94a0a6270
  1. 14
      src/test/test_duellist_spielesammlung_projekt.c

14
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);
}

Loading…
Cancel
Save