mirror of
https://github.com/kierankihn/uno-game.git
synced 2025-12-27 02:13:18 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user