|
|
@ -212,7 +212,20 @@ void test_FieldEmpty_returns_true_for_empty_field(void) { |
|
|
|
TEST_ASSERT_EQUAL(1, result); |
|
|
|
} |
|
|
|
|
|
|
|
void test_FieldEmpty_returns_false_for_nonempty_field(void) { |
|
|
|
// Arrange |
|
|
|
TicTacToeGame game = { .board = {{PLAYER_X, EMPTY, EMPTY}, |
|
|
|
{EMPTY, PLAYER_O, EMPTY}, |
|
|
|
{EMPTY, EMPTY, EMPTY}} }; |
|
|
|
|
|
|
|
// Act |
|
|
|
int result = FieldEmpty(&game, 0, 0); |
|
|
|
|
|
|
|
// Assert |
|
|
|
TEST_ASSERT_EQUAL(0, result); |
|
|
|
} |
|
|
|
|
|
|
|
#endif // TEST |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|