minor changes
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
import pp.mdga.message.client.ClientMessage;
|
import pp.mdga.message.client.ClientMessage;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
@@ -349,7 +350,7 @@ public void testClientGameToCeremony() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UC-ClientState-05: Test the transition from ClientGame sub-states to Interrupt.
|
* UC-ClientState-05: Test the transition from ClientGame substates to Interrupt.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testClientGameSubStatesToInterrupt() {
|
public void testClientGameSubStatesToInterrupt() {
|
||||||
@@ -374,7 +375,7 @@ public void testGameToDialogs() {
|
|||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
|
|
||||||
//receives a GameClosedMessage
|
//receives a GameClosedMessage
|
||||||
clientGameLogic.received();//TODO
|
//clientGameLogic.received();//TODO
|
||||||
|
|
||||||
assertEquals(clientGameLogic.getState(), dialogs);
|
assertEquals(clientGameLogic.getState(), dialogs);
|
||||||
assertEquals(dialogs.getState(), startDialog);
|
assertEquals(dialogs.getState(), startDialog);
|
||||||
@@ -452,7 +453,7 @@ public void testInterruptToDialogs() {
|
|||||||
assertEquals(clientGameLogic.getState(), interrupt);
|
assertEquals(clientGameLogic.getState(), interrupt);
|
||||||
|
|
||||||
//Todo send the server-closed
|
//Todo send the server-closed
|
||||||
clientGameLogic.received();
|
//clientGameLogic.received();
|
||||||
|
|
||||||
//tests if the client is in the startDialog
|
//tests if the client is in the startDialog
|
||||||
assertEquals(clientGameLogic.getState(), dialogs);
|
assertEquals(clientGameLogic.getState(), dialogs);
|
||||||
@@ -881,7 +882,7 @@ public void testWaitToGameEndState() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UC-ClientState-25: Test the transition from Turn sub-states to GameEndState.
|
* UC-ClientState-25: Test the transition from Turn substates to GameEndState.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testTurnSubStatesToGameEndState() {
|
public void testTurnSubStatesToGameEndState() {
|
||||||
@@ -944,7 +945,7 @@ public void testTurnSubStatesToGameEndState() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UC-ClientState-26: Test the transition from Turn sub-states to Wait.
|
* UC-ClientState-26: Test the transition from Turn substates to Wait.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testTurnSubStatesToWait() {
|
public void testTurnSubStatesToWait() {
|
||||||
@@ -1134,7 +1135,7 @@ public void testTurnSubStatesToWait() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UC-ClientState-27: Test the transition from Turn sub-states to Spectator.
|
* UC-ClientState-27: Test the transition from Turn substates to Spectator.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testTurnSubStatesToSpectator() {
|
public void testTurnSubStatesToSpectator() {
|
||||||
@@ -1255,7 +1256,7 @@ public void testSpectatorToGameEndState() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UC-ClientState-29: Test the transition from PowerCard sub-states to PlayPowerCard.
|
* UC-ClientState-29: Test the transition from PowerCard substates to PlayPowerCard.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testPowerCardSubStatesToPlayPowerCard() {
|
public void testPowerCardSubStatesToPlayPowerCard() {
|
||||||
@@ -1315,7 +1316,7 @@ public void testPowerCardSubStatesToPlayPowerCard() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UC-ClientState-30: Test the transition from PowerCard sub-states to RollDice.
|
* UC-ClientState-30: Test the transition from PowerCard substates to RollDice.
|
||||||
* <p>
|
* <p>
|
||||||
* tests the transition from ChoosePowerCard from PowerCard to RollDice
|
* tests the transition from ChoosePowerCard from PowerCard to RollDice
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -149,6 +149,17 @@ public void testMove() {
|
|||||||
@Test
|
@Test
|
||||||
public void testCantMove() {
|
public void testCantMove() {
|
||||||
// TODO: Implement test logic for when a piece can't move
|
// TODO: Implement test logic for when a piece can't move
|
||||||
|
//send server in selectPiece-state
|
||||||
|
|
||||||
|
//set active player
|
||||||
|
|
||||||
|
//set die-class
|
||||||
|
|
||||||
|
//send request Die-message
|
||||||
|
|
||||||
|
//send ..........
|
||||||
|
|
||||||
|
//test
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
package pp.mdga.server.serverState;
|
package pp.mdga.server.serverState;
|
||||||
|
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
import pp.mdga.client.gameState.AnimationState;
|
import pp.mdga.game.*;
|
||||||
import pp.mdga.client.gameState.turnState.PlayPowerCardState;
|
|
||||||
import pp.mdga.game.BonusCard;
|
|
||||||
import pp.mdga.game.Color;
|
|
||||||
import pp.mdga.game.Game;
|
|
||||||
import pp.mdga.game.Piece;
|
|
||||||
import pp.mdga.game.PieceState;
|
|
||||||
import pp.mdga.game.Player;
|
|
||||||
import pp.mdga.message.server.ServerMessage;
|
import pp.mdga.message.server.ServerMessage;
|
||||||
import pp.mdga.message.client.*;
|
import pp.mdga.message.client.*;
|
||||||
import pp.mdga.server.*;
|
import pp.mdga.server.*;
|
||||||
@@ -50,7 +43,6 @@ public class ServerStateTest {
|
|||||||
private SelectTSKMessage selectTSK;
|
private SelectTSKMessage selectTSK;
|
||||||
private StartGameMessage startGame;
|
private StartGameMessage startGame;
|
||||||
|
|
||||||
|
|
||||||
//TODO declare two players
|
//TODO declare two players
|
||||||
|
|
||||||
private Player playerHost;
|
private Player playerHost;
|
||||||
@@ -78,9 +70,8 @@ public class ServerStateTest {
|
|||||||
//todo declare a card for client
|
//todo declare a card for client
|
||||||
private BonusCard bonusCardClient;
|
private BonusCard bonusCardClient;
|
||||||
|
|
||||||
|
|
||||||
//TODO declare the states here
|
//TODO declare the states here
|
||||||
private AnimationState animation;
|
private AnimationState animationState;
|
||||||
private CeremonyState ceremonyState;
|
private CeremonyState ceremonyState;
|
||||||
private ChoosePieceState choosePieceState;
|
private ChoosePieceState choosePieceState;
|
||||||
private DetermineStartPlayerState determineStartPlayerState;
|
private DetermineStartPlayerState determineStartPlayerState;
|
||||||
@@ -89,17 +80,17 @@ public class ServerStateTest {
|
|||||||
private InterruptState interruptState;
|
private InterruptState interruptState;
|
||||||
private LobbyState lobbyState;
|
private LobbyState lobbyState;
|
||||||
private MovePieceState movePieceState;
|
private MovePieceState movePieceState;
|
||||||
private NoPieceState noPiece;
|
private NoPieceState noPieceState;
|
||||||
private NoTurnState noTurnState;
|
private NoTurnState noTurnState;
|
||||||
private PlayPowerCardState playPowerCard;
|
private PlayPowerCardState playPowerCardState;
|
||||||
private PowerCardState powerCardState;
|
private PowerCardState powerCardState;
|
||||||
private RollDiceState rollDiceState;
|
private RollDiceState rollDiceState;
|
||||||
private SecondRollState secondRoll;
|
private SecondRollState secondRollState;
|
||||||
private SelectPieceState selectPiece;
|
private SelectPieceState selectPieceState;
|
||||||
private StartPieceState startPieceState;
|
private StartPieceState startPieceState;
|
||||||
private ThirdRollState thirdRoll;
|
private ThirdRollState thirdRollState;
|
||||||
private TurnState turnState;
|
private TurnState turnState;
|
||||||
private WaitingPieceState waitingPiece;
|
private WaitingPieceState waitingPieceState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this method is used to initialize the attributes of this test-class
|
* this method is used to initialize the attributes of this test-class
|
||||||
@@ -120,6 +111,11 @@ public void send(int id, ServerMessage message) {
|
|||||||
public void broadcast(ServerMessage message) {
|
public void broadcast(ServerMessage message) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disconnectClient(int id) {
|
||||||
|
|
||||||
|
}
|
||||||
}, game);
|
}, game);
|
||||||
|
|
||||||
animationEnd = new AnimationEndMessage();
|
animationEnd = new AnimationEndMessage();
|
||||||
@@ -140,27 +136,26 @@ public void broadcast(ServerMessage message) {
|
|||||||
selectTSK = new SelectTSKMessage();
|
selectTSK = new SelectTSKMessage();
|
||||||
startGame = new StartGameMessage();
|
startGame = new StartGameMessage();
|
||||||
|
|
||||||
|
|
||||||
//initialize the states here
|
//initialize the states here
|
||||||
thirdRoll = rollDiceState.getThirdRollState();
|
thirdRollState = rollDiceState.getThirdRollState();
|
||||||
secondRoll = rollDiceState.getSecondRollState();
|
secondRollState = rollDiceState.getSecondRollState();
|
||||||
firstRollState = rollDiceState.getThirdRollState();
|
firstRollState = rollDiceState.getThirdRollState();
|
||||||
|
|
||||||
noPiece = choosePieceState.getNoPieceState();
|
noPieceState = choosePieceState.getNoPieceState();
|
||||||
noTurnState = choosePieceState.getNoTurnState();
|
noTurnState = choosePieceState.getNoTurnState();
|
||||||
waitingPiece = choosePieceState.getWaitingPieceState();
|
waitingPieceState = choosePieceState.getWaitingPieceState();
|
||||||
startPieceState = choosePieceState.getStartPieceState();
|
startPieceState = choosePieceState.getStartPieceState();
|
||||||
selectPiece =choosePieceState.getSelectPieceState();
|
selectPieceState = choosePieceState.getSelectPieceState();
|
||||||
|
|
||||||
powerCardState = turnState.getPowerCardState();
|
powerCardState = turnState.getPowerCardState();
|
||||||
playPowerCard = turnState.getPlayPowerCardState();
|
playPowerCardState = turnState.getPlayPowerCardState();
|
||||||
rollDiceState = turnState.getRollDiceState();
|
rollDiceState = turnState.getRollDiceState();
|
||||||
choosePieceState = turnState.getChoosePieceState();
|
choosePieceState = turnState.getChoosePieceState();
|
||||||
movePieceState = turnState.getMovePieceState();
|
movePieceState = turnState.getMovePieceState();
|
||||||
|
|
||||||
determineStartPlayerState = gameState.getDetermineStartPlayerState();
|
determineStartPlayerState = gameState.getDetermineStartPlayerState();
|
||||||
turnState = gameState.getTurnState();
|
turnState = gameState.getTurnState();
|
||||||
animation = gameState.getAnimationState();
|
animationState = gameState.getAnimationState();
|
||||||
|
|
||||||
lobbyState = (LobbyState) serverGameLogic.getLobbyState();
|
lobbyState = (LobbyState) serverGameLogic.getLobbyState();
|
||||||
gameState = (GameState) serverGameLogic.getGameState();
|
gameState = (GameState) serverGameLogic.getGameState();
|
||||||
@@ -178,7 +173,7 @@ public void broadcast(ServerMessage message) {
|
|||||||
IDPlayerClient = 2;
|
IDPlayerClient = 2;
|
||||||
playerClientColor = Color.ARMY;
|
playerClientColor = Color.ARMY;
|
||||||
playerClient.setColor(playerClientColor);
|
playerClient.setColor(playerClientColor);
|
||||||
playerClient.addHandCards(bonusCardClient);
|
playerClient.addHandCard(bonusCardClient);
|
||||||
game.addPlayer(IDPlayerClient, playerClient); //TODO random uuid
|
game.addPlayer(IDPlayerClient, playerClient); //TODO random uuid
|
||||||
|
|
||||||
//initialize a piece for client
|
//initialize a piece for client
|
||||||
@@ -200,7 +195,6 @@ public void broadcast(ServerMessage message) {
|
|||||||
|
|
||||||
//initialize the powerCard
|
//initialize the powerCard
|
||||||
bonusCardClient = BonusCard.SHIELD;
|
bonusCardClient = BonusCard.SHIELD;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -222,7 +216,7 @@ public void testLobbyToDetermineStartPlayer() {
|
|||||||
serverGameLogic.setCurrentState(lobbyState);
|
serverGameLogic.setCurrentState(lobbyState);
|
||||||
assertEquals(serverGameLogic.getCurrentState(), lobbyState);
|
assertEquals(serverGameLogic.getCurrentState(), lobbyState);
|
||||||
|
|
||||||
//send all other messages, which dont indicate a state change
|
//send all other messages, which don't indicate a state change
|
||||||
serverGameLogic.received(animationEnd, IDPlayerClient);
|
serverGameLogic.received(animationEnd, IDPlayerClient);
|
||||||
serverGameLogic.received(deselectTSK, IDPlayerClient);
|
serverGameLogic.received(deselectTSK, IDPlayerClient);
|
||||||
serverGameLogic.received(disconnected, IDPlayerClient);
|
serverGameLogic.received(disconnected, IDPlayerClient);
|
||||||
@@ -241,7 +235,6 @@ public void testLobbyToDetermineStartPlayer() {
|
|||||||
serverGameLogic.received(selectTSK, IDPlayerClient);
|
serverGameLogic.received(selectTSK, IDPlayerClient);
|
||||||
//serverGameLogic.received(startGame, IDPlayerClient);
|
//serverGameLogic.received(startGame, IDPlayerClient);
|
||||||
|
|
||||||
|
|
||||||
//tests if the server is still in the lobby-state
|
//tests if the server is still in the lobby-state
|
||||||
assertEquals(serverGameLogic.getLobbyState(), lobbyState);
|
assertEquals(serverGameLogic.getLobbyState(), lobbyState);
|
||||||
|
|
||||||
@@ -271,7 +264,7 @@ public void testStayInLobby() {
|
|||||||
serverGameLogic.setCurrentState(lobbyState);
|
serverGameLogic.setCurrentState(lobbyState);
|
||||||
assertEquals(serverGameLogic.getCurrentState(), lobbyState);
|
assertEquals(serverGameLogic.getCurrentState(), lobbyState);
|
||||||
|
|
||||||
//serverGameLogic gets all messages, which dont indicate a state change
|
//serverGameLogic gets all messages, which don't indicate a state change
|
||||||
serverGameLogic.received(animationEnd, IDPlayerClient);
|
serverGameLogic.received(animationEnd, IDPlayerClient);
|
||||||
serverGameLogic.received(deselectTSK, IDPlayerClient);
|
serverGameLogic.received(deselectTSK, IDPlayerClient);
|
||||||
//serverGameLogic.received(disconnected, IDPlayerClient);
|
//serverGameLogic.received(disconnected, IDPlayerClient);
|
||||||
@@ -489,7 +482,7 @@ public void testDetermineStartPlayerToAnimation() {
|
|||||||
|
|
||||||
//tests if the Server is in animationState
|
//tests if the Server is in animationState
|
||||||
assertEquals(serverGameLogic.getCurrentState(), gameState);
|
assertEquals(serverGameLogic.getCurrentState(), gameState);
|
||||||
assertEquals(gameState.getCurrentState() ,animation);
|
assertEquals(gameState.getCurrentState(), animationState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -503,13 +496,13 @@ public void testAnimationToPowerCard() {
|
|||||||
assertEquals(serverGameLogic.getCurrentState(), gameState);
|
assertEquals(serverGameLogic.getCurrentState(), gameState);
|
||||||
|
|
||||||
//sends the gameState in Animation
|
//sends the gameState in Animation
|
||||||
gameState.setCurrentState(animation);
|
gameState.setCurrentState(animationState);
|
||||||
assertEquals(gameState.getCurrentState() ,animation);
|
assertEquals(gameState.getCurrentState(), animationState);
|
||||||
|
|
||||||
//receives one animation endMessage and tests if the server is still in the Animation-state
|
//receives one animation endMessage and tests if the server is still in the Animation-state
|
||||||
serverGameLogic.received(animationEnd, IDPlayerClient);
|
serverGameLogic.received(animationEnd, IDPlayerClient);
|
||||||
assertEquals(serverGameLogic.getCurrentState(), gameState);
|
assertEquals(serverGameLogic.getCurrentState(), gameState);
|
||||||
assertEquals(gameState.getCurrentState() ,animation);
|
assertEquals(gameState.getCurrentState(), animationState);
|
||||||
|
|
||||||
//receives another animation endMessage
|
//receives another animation endMessage
|
||||||
serverGameLogic.received(animationEnd, IDPlayerClient);
|
serverGameLogic.received(animationEnd, IDPlayerClient);
|
||||||
@@ -535,8 +528,8 @@ public void testTurnToAnimation() {
|
|||||||
assertEquals(gameState.getCurrentState(), turnState);
|
assertEquals(gameState.getCurrentState(), turnState);
|
||||||
|
|
||||||
//sends the server in Animation
|
//sends the server in Animation
|
||||||
turnState.setCurrentState(animation);
|
turnState.setCurrentState(movePieceState);
|
||||||
assertEquals(turnState.getState(),animation);
|
assertEquals(turnState.getCurrentState(), movePieceState);
|
||||||
|
|
||||||
//set dices-eyes in game !=6
|
//set dices-eyes in game !=6
|
||||||
game.setDiceEyes(4);
|
game.setDiceEyes(4);
|
||||||
@@ -544,17 +537,17 @@ public void testTurnToAnimation() {
|
|||||||
//serverGameLogic receives animationEndMessages
|
//serverGameLogic receives animationEndMessages
|
||||||
serverGameLogic.received(animationEnd, IDPlayerClient);
|
serverGameLogic.received(animationEnd, IDPlayerClient);
|
||||||
|
|
||||||
//tests if the server is still in Animation-State
|
//tests if the server is still in movePieceState
|
||||||
assertEquals(serverGameLogic.getCurrentState(), gameState);
|
assertEquals(serverGameLogic.getCurrentState(), gameState);
|
||||||
assertEquals(gameState.getCurrentState(), turnState);
|
assertEquals(gameState.getCurrentState(), turnState);
|
||||||
assertEquals(turnState.getState(),animation);
|
assertEquals(turnState.getCurrentState(), movePieceState);
|
||||||
|
|
||||||
//sends the second animationEndMessage
|
//sends the second animationEndMessage
|
||||||
serverGameLogic.received(animationEnd, IDPlayerHost);
|
serverGameLogic.received(animationEnd, IDPlayerHost);
|
||||||
|
|
||||||
//tests if the server is in the AnimationState
|
//tests if the server is in the AnimationState
|
||||||
assertEquals(serverGameLogic.getCurrentState(), gameState);
|
assertEquals(serverGameLogic.getCurrentState(), gameState);
|
||||||
assertEquals(gameState.getCurrentState() ,animation);
|
assertEquals(gameState.getCurrentState(), animationState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -643,7 +636,7 @@ public void testPowerCardToPlayPowerCard() {
|
|||||||
//tests if the server is in PlayPowerCard
|
//tests if the server is in PlayPowerCard
|
||||||
assertEquals(serverGameLogic.getCurrentState(), gameState);
|
assertEquals(serverGameLogic.getCurrentState(), gameState);
|
||||||
assertEquals(gameState.getCurrentState(), turnState);
|
assertEquals(gameState.getCurrentState(), turnState);
|
||||||
assertEquals(turnState.getCurrentState() ,playPowerCard);
|
assertEquals(turnState.getCurrentState(), playPowerCardState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -661,14 +654,14 @@ public void testPlayPowerCardToRollDice() {
|
|||||||
assertEquals(gameState.getCurrentState(), turnState);
|
assertEquals(gameState.getCurrentState(), turnState);
|
||||||
|
|
||||||
//sends the TurnState in PowerCard
|
//sends the TurnState in PowerCard
|
||||||
turnState.setCurrentState(playPowerCard);
|
turnState.setCurrentState(playPowerCardState);
|
||||||
assertEquals(turnState.getCurrentState() ,playPowerCard);
|
assertEquals(turnState.getCurrentState(), playPowerCardState);
|
||||||
|
|
||||||
//receive first AnimationEndMessage IDPlayerClient the host
|
//receive first AnimationEndMessage IDPlayerClient the host
|
||||||
serverGameLogic.received(animationEnd, IDPlayerClient);
|
serverGameLogic.received(animationEnd, IDPlayerClient);
|
||||||
assertEquals(serverGameLogic.getCurrentState(), gameState);
|
assertEquals(serverGameLogic.getCurrentState(), gameState);
|
||||||
assertEquals(gameState.getCurrentState(), turnState);
|
assertEquals(gameState.getCurrentState(), turnState);
|
||||||
assertEquals(turnState.getCurrentState() ,playPowerCard);
|
assertEquals(turnState.getCurrentState(), playPowerCardState);
|
||||||
|
|
||||||
//receive second AnimationEndMessage
|
//receive second AnimationEndMessage
|
||||||
serverGameLogic.received(animationEnd, IDPlayerClient);
|
serverGameLogic.received(animationEnd, IDPlayerClient);
|
||||||
@@ -835,7 +828,7 @@ public void testSecondRollToRollDiceEndState() {
|
|||||||
assertEquals(turnState.getCurrentState(), rollDiceState);
|
assertEquals(turnState.getCurrentState(), rollDiceState);
|
||||||
|
|
||||||
//sends the RollDiceState in SecondRoll
|
//sends the RollDiceState in SecondRoll
|
||||||
rollDiceState.setCurrentState(secondRoll);
|
rollDiceState.setCurrentState(secondRollState);
|
||||||
assertEquals(rollDiceState.getCurrentState(), secondRollState);
|
assertEquals(rollDiceState.getCurrentState(), secondRollState);
|
||||||
|
|
||||||
//Todo
|
//Todo
|
||||||
@@ -866,7 +859,7 @@ public void testSecondRollToThirdRoll() {
|
|||||||
assertEquals(turnState.getCurrentState(), rollDiceState);
|
assertEquals(turnState.getCurrentState(), rollDiceState);
|
||||||
|
|
||||||
//sends the RollDiceState in SecondRoll
|
//sends the RollDiceState in SecondRoll
|
||||||
rollDiceState.setCurrentState(secondRoll);
|
rollDiceState.setCurrentState(secondRollState);
|
||||||
assertEquals(rollDiceState.getCurrentState(), secondRollState);
|
assertEquals(rollDiceState.getCurrentState(), secondRollState);
|
||||||
|
|
||||||
//Todo player has no figures to move and had no 6
|
//Todo player has no figures to move and had no 6
|
||||||
@@ -897,7 +890,7 @@ public void testThirdRollToRollDiceEndState() {
|
|||||||
assertEquals(turnState.getCurrentState(), rollDiceState);
|
assertEquals(turnState.getCurrentState(), rollDiceState);
|
||||||
|
|
||||||
//sends the RollDiceState in ThirdRoll
|
//sends the RollDiceState in ThirdRoll
|
||||||
rollDiceState.setCurrentState(thirdRoll);
|
rollDiceState.setCurrentState(thirdRollState);
|
||||||
assertEquals(rollDiceState.getCurrentState(), thirdRollState);
|
assertEquals(rollDiceState.getCurrentState(), thirdRollState);
|
||||||
|
|
||||||
//Todo
|
//Todo
|
||||||
@@ -928,7 +921,7 @@ public void testThirdRollToTurnEndState() {
|
|||||||
assertEquals(turnState.getCurrentState(), rollDiceState);
|
assertEquals(turnState.getCurrentState(), rollDiceState);
|
||||||
|
|
||||||
//sends the RollDiceState in ThirdRoll
|
//sends the RollDiceState in ThirdRoll
|
||||||
rollDiceState.setCurrentState(thirdRoll);
|
rollDiceState.setCurrentState(thirdRollState);
|
||||||
assertEquals(rollDiceState.getCurrentState(), thirdRollState);
|
assertEquals(rollDiceState.getCurrentState(), thirdRollState);
|
||||||
|
|
||||||
//Todo
|
//Todo
|
||||||
@@ -953,7 +946,7 @@ public void testNoPieceToWaitingPiece() {
|
|||||||
assertEquals(turnState.getCurrentState(), choosePieceState);
|
assertEquals(turnState.getCurrentState(), choosePieceState);
|
||||||
|
|
||||||
//sends the server in NoPiece
|
//sends the server in NoPiece
|
||||||
choosePieceState.setCurrentState(noPiece);
|
choosePieceState.setCurrentState(noPieceState);
|
||||||
assertEquals(choosePieceState.getCurrentState(), noPieceState);
|
assertEquals(choosePieceState.getCurrentState(), noPieceState);
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
@@ -963,7 +956,6 @@ public void testNoPieceToWaitingPiece() {
|
|||||||
assertEquals(gameState.getCurrentState(), turnState);
|
assertEquals(gameState.getCurrentState(), turnState);
|
||||||
assertEquals(turnState.getCurrentState(), choosePieceState);
|
assertEquals(turnState.getCurrentState(), choosePieceState);
|
||||||
assertEquals(choosePieceState.getCurrentState(), waitingPieceState);
|
assertEquals(choosePieceState.getCurrentState(), waitingPieceState);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -985,7 +977,7 @@ public void testNoPieceToNoTurn() {
|
|||||||
assertEquals(turnState.getCurrentState(), choosePieceState);
|
assertEquals(turnState.getCurrentState(), choosePieceState);
|
||||||
|
|
||||||
//sends the server in NoPiece
|
//sends the server in NoPiece
|
||||||
choosePieceState.setCurrentState(noPiece);
|
choosePieceState.setCurrentState(noPieceState);
|
||||||
assertEquals(choosePieceState.getCurrentState(), noPieceState);
|
assertEquals(choosePieceState.getCurrentState(), noPieceState);
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
@@ -1041,7 +1033,7 @@ public void testStayInWaitingPiece() {
|
|||||||
assertEquals(turnState.getCurrentState(), choosePieceState);
|
assertEquals(turnState.getCurrentState(), choosePieceState);
|
||||||
|
|
||||||
//sends the server in WaitingPiece
|
//sends the server in WaitingPiece
|
||||||
choosePieceState.setCurrentState(waitingPiece);
|
choosePieceState.setCurrentState(waitingPieceState);
|
||||||
assertEquals(choosePieceState.getCurrentState(), waitingPieceState);
|
assertEquals(choosePieceState.getCurrentState(), waitingPieceState);
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
@@ -1072,7 +1064,7 @@ public void testWaitingPieceToMovePiece() {
|
|||||||
assertEquals(turnState.getCurrentState(), choosePieceState);
|
assertEquals(turnState.getCurrentState(), choosePieceState);
|
||||||
|
|
||||||
//sends the server in WaitingPiece
|
//sends the server in WaitingPiece
|
||||||
choosePieceState.setCurrentState(waitingPiece);
|
choosePieceState.setCurrentState(waitingPieceState);
|
||||||
assertEquals(choosePieceState.getCurrentState(), waitingPieceState);
|
assertEquals(choosePieceState.getCurrentState(), waitingPieceState);
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
@@ -1097,7 +1089,7 @@ public void testNoPieceToSelectPiece() {
|
|||||||
assertEquals(turnState.getCurrentState(), choosePieceState);
|
assertEquals(turnState.getCurrentState(), choosePieceState);
|
||||||
|
|
||||||
//sends the server in NoPiece
|
//sends the server in NoPiece
|
||||||
choosePieceState.setCurrentState(noPiece);
|
choosePieceState.setCurrentState(noPieceState);
|
||||||
assertEquals(choosePieceState.getCurrentState(), noPieceState);
|
assertEquals(choosePieceState.getCurrentState(), noPieceState);
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
@@ -1128,7 +1120,7 @@ public void testNoPieceToStartPiece() {
|
|||||||
assertEquals(turnState.getCurrentState(), choosePieceState);
|
assertEquals(turnState.getCurrentState(), choosePieceState);
|
||||||
|
|
||||||
//sends the server in NoPiece
|
//sends the server in NoPiece
|
||||||
choosePieceState.setCurrentState(noPiece);
|
choosePieceState.setCurrentState(noPieceState);
|
||||||
assertEquals(choosePieceState.getCurrentState(), noPieceState);
|
assertEquals(choosePieceState.getCurrentState(), noPieceState);
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
@@ -1159,7 +1151,7 @@ public void testStayInSelectPiece() {
|
|||||||
assertEquals(turnState.getCurrentState(), choosePieceState);
|
assertEquals(turnState.getCurrentState(), choosePieceState);
|
||||||
|
|
||||||
//sends the server in SelectPiece
|
//sends the server in SelectPiece
|
||||||
choosePieceState.setCurrentState(selectPiece);
|
choosePieceState.setCurrentState(selectPieceState);
|
||||||
assertEquals(choosePieceState.getCurrentState(), selectPieceState);
|
assertEquals(choosePieceState.getCurrentState(), selectPieceState);
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
@@ -1190,7 +1182,7 @@ public void testSelectPieceToMovePiece() {
|
|||||||
assertEquals(turnState.getCurrentState(), choosePieceState);
|
assertEquals(turnState.getCurrentState(), choosePieceState);
|
||||||
|
|
||||||
//sends the server in SelectPiece
|
//sends the server in SelectPiece
|
||||||
choosePieceState.setCurrentState(selectPiece);
|
choosePieceState.setCurrentState(selectPieceState);
|
||||||
assertEquals(choosePieceState.getCurrentState(), selectPieceState);
|
assertEquals(choosePieceState.getCurrentState(), selectPieceState);
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
@@ -1220,7 +1212,7 @@ public void testStayInStartPiece() {
|
|||||||
assertEquals(turnState.getCurrentState(), choosePieceState);
|
assertEquals(turnState.getCurrentState(), choosePieceState);
|
||||||
|
|
||||||
//sends the server in StartPiece
|
//sends the server in StartPiece
|
||||||
choosePieceState.setCurrentState(startPiece);
|
choosePieceState.setCurrentState(startPieceState);
|
||||||
assertEquals(choosePieceState.getCurrentState(), startPieceState);
|
assertEquals(choosePieceState.getCurrentState(), startPieceState);
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
@@ -1251,7 +1243,7 @@ public void testStartPieceToMovePiece() {
|
|||||||
assertEquals(turnState.getCurrentState(), choosePieceState);
|
assertEquals(turnState.getCurrentState(), choosePieceState);
|
||||||
|
|
||||||
//sends the server in StartPiece
|
//sends the server in StartPiece
|
||||||
choosePieceState.setCurrentState(startPiece);
|
choosePieceState.setCurrentState(startPieceState);
|
||||||
assertEquals(choosePieceState.getCurrentState(), startPieceState);
|
assertEquals(choosePieceState.getCurrentState(), startPieceState);
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
|
|||||||
Reference in New Issue
Block a user