Skip to content

Commit 0399c3e

Browse files
author
ankit21
committed
//
1 parent be18ef4 commit 0399c3e

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

tests/test_Player.cpp

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,28 @@ TEST(PlayerTest, Monopoly_card_2){
415415

416416
}
417417

418+
419+
420+
TEST(PlayerTest, Monopoly_card_2){
421+
GameBoard board({"test-player1", "test-player2"});
422+
423+
Player& tp1 = board.getPlayer(0);
424+
Player& tp2 = board.getPlayer(1);
425+
426+
std::unique_ptr<DevelopmentCard> test_MonopolyCard = std::unique_ptr<DevelopmentCard>(new MonopolyCard());
427+
tp1.buyCard(test_MonopolyCard);
428+
429+
tp1.addMultiple(0,0,0,1,1);
430+
tp2.addMultiple(1,1,0,0,0);
431+
432+
tp1.playMonopoly(0);
433+
434+
ASSERT_TRUE(validateResourceAmount(0,0,0,1,1,tp1));
435+
ASSERT_TRUE(validateResourceAmount(1,1,0,0,0,tp2));
436+
437+
}
438+
439+
418440
TEST(PlayerTest, Monopoly_card_false){
419441
GameBoard board({"test-player1", "test-player2"});
420442

@@ -452,6 +474,38 @@ TEST(PlayerTest, Year_Of_Plenty_card){
452474

453475

454476

477+
TEST(PlayerTest, Year_Of_Plenty_card_false){
478+
GameBoard board({"test-player1"});
479+
480+
Player& tp1 = board.getPlayer(0);
481+
482+
std::unique_ptr<DevelopmentCard> test_YearOfPlentyCard = std::unique_ptr<DevelopmentCard>(new YearOfPlentyCard());
483+
tp1.buyCard(test_YearOfPlentyCard);
484+
485+
tp1.addMultiple(0,0,0,1,1);
486+
487+
tp1.playYearOfPlenty(2);
488+
489+
ASSERT_TRUE(validateResourceAmount(0,0,0,1,1,tp1));
490+
491+
}
492+
493+
494+
TEST(PlayerTest, Year_Of_Plenty_card_false_2){
495+
GameBoard board({"test-player1"});
496+
497+
Player& tp1 = board.getPlayer(0);
498+
499+
tp1.addMultiple(0,0,0,1,1);
500+
501+
tp1.playYearOfPlenty(2);
502+
503+
ASSERT_TRUE(validateResourceAmount(0,0,0,1,1,tp1));
504+
505+
}
506+
507+
508+
455509
//INSERT TRADING TESTS HERE
456510

457511
TEST(PlayerTest, Trade_positive){

0 commit comments

Comments
 (0)