Browse Source

Unittest: vertikal gewinnt

remotes/origin/homan
fdai7892 11 months ago
parent
commit
058e352336
  1. 37
      src/test/test_duellist_spielesammlung_projekt.c

37
src/test/test_duellist_spielesammlung_projekt.c

@ -30,4 +30,39 @@ void test_coinflip_player_o_starts(void) {
// Assert // Assert
TEST_ASSERT_EQUAL(SUCCESS, result); TEST_ASSERT_EQUAL(SUCCESS, result);
TEST_ASSERT_TRUE(game.currentPlayer == PLAYER_X || game.currentPlayer == PLAYER_O); TEST_ASSERT_TRUE(game.currentPlayer == PLAYER_X || game.currentPlayer == PLAYER_O);
}
}
void test_vertical_win(void) {
// Arrange
TicTacToeGame game = { .board = {{PLAYER_X, EMPTY, EMPTY},
{PLAYER_X, EMPTY, EMPTY},
{PLAYER_X, EMPTY, EMPTY}},
.currentPlayer = PLAYER_O };
// Act
GameResult result = checkGameResult(&game);
// Assert
TEST_ASSERT_EQUAL(GAME_WIN, result);
}
Loading…
Cancel
Save