|
|
@ -146,7 +146,19 @@ void test_invalid_input_type2(void) { |
|
|
|
TEST_ASSERT_EQUAL(INVALID_MOVE, result); |
|
|
|
} |
|
|
|
|
|
|
|
void test_getNumberOfMoves_returns_correct_number_of_moves(void) { |
|
|
|
// Arrange |
|
|
|
TicTacToeGame game = { .board = {{PLAYER_X, EMPTY, EMPTY}, |
|
|
|
{EMPTY, PLAYER_O, EMPTY}, |
|
|
|
{EMPTY, EMPTY, EMPTY}}, |
|
|
|
.currentPlayer = PLAYER_X }; |
|
|
|
|
|
|
|
// Act |
|
|
|
int moves = getNumberOfMoves(&game); |
|
|
|
|
|
|
|
// Assert |
|
|
|
TEST_ASSERT_EQUAL(2, moves); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|