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