Browse Source

Test.CheckIfCardsPlayedByBotWillTurnFaceUp

main
fdai7793 11 months ago
parent
commit
9284d001e8
  1. 17
      src/test/java/de/hsfulda/onses/GameServiceTest.java

17
src/test/java/de/hsfulda/onses/GameServiceTest.java

@ -504,4 +504,21 @@ public class GameServiceTest {
assertTrue(gameService.getGame().getPlayerService().getPlayerList().getLast().getPlayerDeck().get(i).isFacedown());
}
}
@Test
@DisplayName("CheckIfCardsPlayedByBotWillTurnFaceUp")
public void CheckIfCardsPlayedByBotWillTurnFaceUp() {
GameService gameService = new GameService();
Card card = new Card().setColor(Card.Color.GREEN).setValue(Card.Value.FOUR).setFacedown(true);
gameService.getGame().getPlayerService().setCurrentTurn(false);
gameService.getGame().setLastPlayedCard(new Card().setColor(Card.Color.GREEN).setValue(Card.Value.FIVE));
gameService.getGame().getPlayerService().getPlayerList().getLast().getPlayerDeck().clear();
gameService.getGame().getPlayerService().getPlayerList().getLast().getPlayerDeck().add(card);
gameService.getGame().getPlayerService().botMove();
assertFalse(gameService.getGame().getLastPlayedCard().isFacedown());
}
}
Loading…
Cancel
Save