added one more test-class

This commit is contained in:
Benjamin Feyer
2024-12-02 04:40:49 +01:00
parent 798b6ebe1d
commit 314019a632

View File

@@ -540,16 +540,34 @@ public void testShufflePile() {
*/
@Test
public void testEnterHouse() {
// TODO: Implement test logic for entering the house area
//sets the active Player to Client
//sends the server in firstRoll
serverGameLogic.setCurrentState(gameState);
gameState.setCurrentState(turnState);
turnState.setCurrentState(rollDiceState);
rollDiceState.setCurrentState(firstRollState);
//sets the dice-seed to 1
//tests if the server is in firstRoll
assertEquals(serverGameLogic.getCurrentState(),gameState);
assertEquals(gameState.getCurrentState(), turnState);
assertEquals(turnState.getCurrentState(),rollDiceState);
assertEquals(rollDiceState.getCurrentState(),firstRollState);
//send requestDice-Message
//set activePlayer to client
game.setActiveColor(clientColor);
//sends requestMoveMessage with clientPiece 02
//set the die in Game to 1
game.setDie(die1);
//sends the request-Dice-message
serverGameLogic.received(new RequestDieMessage(),IDClient);
//sends the requestMove-message for pieceClient1
serverGameLogic.received(new RequestMoveMessage(pieceClient2.getUuid()),IDClient);
//tests, if the piece is in the first slot of the home
assertTrue(game.getBoard().getPlayerData().get(clientColor).getHomeNodes()[0].isOccupied());
assertEquals(game.getBoard().getPlayerData().get(clientColor).getHomeNodes()[0].getOccupant(),pieceClient2);
assertFalse(game.getBoard().getInfield()[19].isOccupied());
}
/**
@@ -572,7 +590,7 @@ public void testOnlyEnterOwnHouse() {
assertEquals(turnState.getCurrentState(),rollDiceState);
assertEquals(rollDiceState.getCurrentState(),firstRollState);
//set activePlayer to client
//set activePlayer to host
game.setActiveColor(hostColor);
//set the die in Game to 3