added a testmethod for the piece for no powerCards

This commit is contained in:
Benjamin Feyer
2024-12-02 15:57:53 +01:00
parent 314019a632
commit 0f2766918b

View File

@@ -22,6 +22,7 @@
import pp.mdga.server.automaton.game.turn.rolldice.FirstRollState;
import java.sql.SQLOutput;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
@@ -490,20 +491,31 @@ public void testReachBonusField() {
public void testNoPowerCards() {
// TODO: Implement test logic for when there are no power cards available
//sets the active Player to Host
game.setActiveColor(hostColor);
//sets the dice-seed to 4
game.setDie(die4);
//sets the pile empty
game.setDrawPile(new ArrayList<>());
assertTrue(game.getDrawPile().isEmpty());
//sets the discard pile empty
game.setDiscardPile(new ArrayList<>());
assertTrue(game.getDiscardPile().isEmpty());
//sends the requestDice-Message
serverGameLogic.received(new RequestMoveMessage(pieceHost1.getUuid()),IDHost);
// requestMOve of hostPiece3
serverGameLogic.received(new RequestMoveMessage(pieceHost3.getUuid()),IDHost);
//tests the position of hostPiece3
assertTrue(game.getBoard().getInfield()[4].isOccupied());
assertEquals(game.getBoard().getInfield()[4].getOccupant(),pieceHost3);
//tests if the player has received no a bonusCard
//tests if the player has received a bonusCard
assertTrue(game.getDrawPile().isEmpty());
assertTrue(game.getPlayers().get(IDHost).getHandCards().stream().toList().isEmpty());
}
/**