|
@ -146,7 +146,7 @@ void test_invalid_input_overflow_column(void) { |
|
|
TEST_ASSERT_EQUAL(INVALID_MOVE, result); |
|
|
TEST_ASSERT_EQUAL(INVALID_MOVE, result); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test_getNumberOfMoves_returns_correct_number_of_moves(void) { |
|
|
|
|
|
|
|
|
void test_NumberOfMoves_returns_correct_number_of_moves(void) { |
|
|
// Arrange |
|
|
// Arrange |
|
|
TicTacToeGame game = { .board = {{PLAYER_X, EMPTY, EMPTY}, |
|
|
TicTacToeGame game = { .board = {{PLAYER_X, EMPTY, EMPTY}, |
|
|
{EMPTY, PLAYER_O, EMPTY}, |
|
|
{EMPTY, PLAYER_O, EMPTY}, |
|
@ -154,7 +154,7 @@ void test_getNumberOfMoves_returns_correct_number_of_moves(void) { |
|
|
.currentPlayer = PLAYER_X }; |
|
|
.currentPlayer = PLAYER_X }; |
|
|
|
|
|
|
|
|
// Act |
|
|
// Act |
|
|
int moves = getNumberOfMoves(&game); |
|
|
|
|
|
|
|
|
int moves = NumberOfMoves(&game); |
|
|
|
|
|
|
|
|
// Assert |
|
|
// Assert |
|
|
TEST_ASSERT_EQUAL(2, moves); |
|
|
TEST_ASSERT_EQUAL(2, moves); |
|
@ -186,7 +186,7 @@ void test_BoardFull_returns_true_when_board_is_full(void) { |
|
|
// Assert |
|
|
// Assert |
|
|
TEST_ASSERT_TRUE(boardFull); |
|
|
TEST_ASSERT_TRUE(boardFull); |
|
|
} |
|
|
} |
|
|
void test_getCurrentPlayer_returns_correct_player(void) { |
|
|
|
|
|
|
|
|
void test_CurrentPlayer_returns_correct_player(void) { |
|
|
// Arrange |
|
|
// Arrange |
|
|
TicTacToeGame game = { .board = {{PLAYER_X, EMPTY, EMPTY}, |
|
|
TicTacToeGame game = { .board = {{PLAYER_X, EMPTY, EMPTY}, |
|
|
{EMPTY, PLAYER_O, EMPTY}, |
|
|
{EMPTY, PLAYER_O, EMPTY}, |
|
@ -194,7 +194,7 @@ void test_getCurrentPlayer_returns_correct_player(void) { |
|
|
.currentPlayer = PLAYER_O }; |
|
|
.currentPlayer = PLAYER_O }; |
|
|
|
|
|
|
|
|
// Act |
|
|
// Act |
|
|
Player currentPlayer = getCurrentPlayer(&game); |
|
|
|
|
|
|
|
|
Player currentPlayer = CurrentPlayer(&game); |
|
|
|
|
|
|
|
|
// Assert |
|
|
// Assert |
|
|
TEST_ASSERT_EQUAL(PLAYER_O, currentPlayer); |
|
|
TEST_ASSERT_EQUAL(PLAYER_O, currentPlayer); |
|
|