|
|
@ -259,4 +259,22 @@ public class GameServiceTest { |
|
|
|
assertEquals(expected, answer); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
@DisplayName("DrawCardDeckRemoveTest") |
|
|
|
public void DrawCardDeckRemoveTest () |
|
|
|
{ |
|
|
|
GameService gameService = new GameService(); |
|
|
|
Card card = gameService.getGame().getDrawCardDeck().getFirst(); |
|
|
|
gameService.drawCard(1); |
|
|
|
int counter = 0; |
|
|
|
int expected = 0; |
|
|
|
for (int i = 0; i < gameService.getGame().getDrawCardDeck().size(); i++) { |
|
|
|
if (gameService.getGame().getDrawCardDeck().get(i).getColor() == card.getColor() && gameService.getGame().getDrawCardDeck().get(i).getValue() == card.getValue()) counter++; |
|
|
|
} |
|
|
|
if (card.getColor() == Card.Color.BLACK) expected = 3; |
|
|
|
else expected = 1; |
|
|
|
|
|
|
|
assertEquals(expected, counter); |
|
|
|
} |
|
|
|
|
|
|
|
} |