added one more test-class
This commit is contained in:
@@ -540,16 +540,34 @@ public void testShufflePile() {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testEnterHouse() {
|
public void testEnterHouse() {
|
||||||
// TODO: Implement test logic for entering the house area
|
//sends the server in firstRoll
|
||||||
//sets the active Player to Client
|
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
|
//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(turnState.getCurrentState(),rollDiceState);
|
||||||
assertEquals(rollDiceState.getCurrentState(),firstRollState);
|
assertEquals(rollDiceState.getCurrentState(),firstRollState);
|
||||||
|
|
||||||
//set activePlayer to client
|
//set activePlayer to host
|
||||||
game.setActiveColor(hostColor);
|
game.setActiveColor(hostColor);
|
||||||
|
|
||||||
//set the die in Game to 3
|
//set the die in Game to 3
|
||||||
|
|||||||
Reference in New Issue
Block a user