test(game): simplify card play and player initialization in tests

- Updated `HandCard::play` usage to accept a dereferenced card.
- Replaced sequential `addPlayer` calls with `init` method in `GameStateTest`.
This commit is contained in:
Kieran Kihn
2025-12-07 19:33:29 +08:00
parent d266f1c514
commit 9ae3b9cc89
2 changed files with 2 additions and 5 deletions

View File

@@ -25,7 +25,7 @@ TEST(player_test, player_test_1)
ASSERT_EQ(handCard.getCards().begin()->getColor(), UNO::GAME::CardColor::RED);
ASSERT_EQ(handCard.getCards().begin()->getType(), UNO::GAME::CardType::NUM1);
handCard.play(handCard.getCards().begin());
handCard.play(*handCard.getCards().begin());
ASSERT_EQ(handCard.getCards().begin()->getColor(), UNO::GAME::CardColor::RED);
ASSERT_EQ(handCard.getCards().begin()->getType(), UNO::GAME::CardType::SKIP);