added some mor testcases for the clientstatemachine
This commit is contained in:
@@ -236,7 +236,7 @@ public void testDialogsToClientStateEndState() {
|
||||
public void testClientGameToCeremony() {
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
|
||||
//tests if the client is in GameState
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
@@ -259,7 +259,7 @@ public void testClientGameToCeremony() {
|
||||
@Test
|
||||
public void testClientGameSubStatesToInterrupt() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
|
||||
//tests if the client is in GameState
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
@@ -286,7 +286,7 @@ public void testGameToDialogs() {
|
||||
public void testStayInInterrupt() {
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(interrupt);
|
||||
clientAutomaton.gotoState(interrupt);
|
||||
|
||||
//tests if the client is in GameState
|
||||
assertTrue(clientAutomaton.getState() instanceof Interrupt);
|
||||
@@ -301,7 +301,7 @@ public void testStayInInterrupt() {
|
||||
public void testClientInterruptToGame() {
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(interrupt);
|
||||
clientAutomaton.gotoState(interrupt);
|
||||
|
||||
//tests if the client is in GameState
|
||||
assertTrue(clientAutomaton.getState() instanceof Interrupt);
|
||||
@@ -316,7 +316,7 @@ public void testClientInterruptToGame() {
|
||||
public void testInterruptToDialogs() {
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(interrupt);
|
||||
clientAutomaton.gotoState(interrupt);
|
||||
|
||||
//tests if the client is in GameState
|
||||
assertTrue(clientAutomaton.getState() instanceof Interrupt);
|
||||
@@ -331,7 +331,7 @@ public void testInterruptToDialogs() {
|
||||
public void testCeremonyToDialogs() {
|
||||
// Todo Implementation goes here
|
||||
//send the client in the ceremony
|
||||
clientAutomaton.goto(ceremony);
|
||||
clientAutomaton.gotoState(ceremony);
|
||||
assertTrue(clientAutomaton.getStates() instanceof Ceremony);
|
||||
|
||||
//Todo
|
||||
@@ -418,7 +418,7 @@ public void testLobbyToRollRankingDice() {
|
||||
assertTrue(clientAutomaton.getState() instanceof Dialogs);
|
||||
Dialogs dialogs1 = (Dialogs) clientAutomaton.getState();
|
||||
DialogsStateMachine dialogsStateMachine1 = lobby.getDialogsStatemachine();
|
||||
dialogsStateMachine1.goto(lobby);
|
||||
dialogsStateMachine1.gotoState(lobby);
|
||||
assertTrue(dialogsStateMachine1.getState() instanceof Lobby);
|
||||
|
||||
//sends the message to start the game
|
||||
@@ -453,14 +453,14 @@ public void testDetermineStartPlayerToWait() {
|
||||
public void testWaitToAnimation() {
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
|
||||
//tests if the client is in GameState
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the client in WaitState
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.goto(waiting);
|
||||
gameStateMachine1.gotoState(waiting);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Waiting);
|
||||
|
||||
//tests if a piece is moved,that the client goes into Animation
|
||||
@@ -468,7 +468,7 @@ public void testWaitToAnimation() {
|
||||
assertTrue(gameStateMachine1.getState() instanceof Animation);
|
||||
|
||||
//sends the client in WaitState
|
||||
gameStateMachine1.goto(waiting);
|
||||
gameStateMachine1.gotoState(waiting);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Waiting);
|
||||
|
||||
//tests if a powerCard is played,that the client goes into Animation
|
||||
@@ -476,7 +476,7 @@ public void testWaitToAnimation() {
|
||||
assertTrue(gameStateMachine1.getState() instanceof Animation);
|
||||
|
||||
//sends the client in WaitState
|
||||
gameStateMachine1.goto(waiting);
|
||||
gameStateMachine1.gotoState(waiting);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Waiting);
|
||||
|
||||
//tests if a die is rolled,that the client goes into Animation
|
||||
@@ -491,12 +491,12 @@ public void testWaitToAnimation() {
|
||||
public void testWaitToTurn() {
|
||||
//TODo
|
||||
//sends client in gameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.goto(wait);
|
||||
gameStateMachine1.gotoState(wait);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//the client receives the message ActivePlayer
|
||||
@@ -577,17 +577,17 @@ public void testPowerCardSubStatesToRollDice() {
|
||||
public void testStayInPlayPowerCard() {
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.goto(turn);
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in PlayPowerCard
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.goto(playPowerCard);
|
||||
turnStateMachine1.gotoState(playPowerCard);
|
||||
assertTrue(turnStateMachine1.getState() instanceof PlayPowerCard);
|
||||
|
||||
//Todo send messages to test to stay in playPowerCard
|
||||
@@ -601,17 +601,17 @@ public void testStayInPlayPowerCard() {
|
||||
public void testPlayPowerCardToRollDice() {
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.goto(turn);
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in PlayPowerCard
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.goto(playPowerCard);
|
||||
turnStateMachine1.gotoState(playPowerCard);
|
||||
assertTrue(turnStateMachine1.getState() instanceof PlayPowerCard);
|
||||
|
||||
//Todo send messages to test the transition in rollDice
|
||||
@@ -696,7 +696,31 @@ public void testStayInChoosePowerCard() {
|
||||
*/
|
||||
@Test
|
||||
public void testChoosePowerCardToRollDice() {
|
||||
// Implementation goes here
|
||||
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in PowerCard
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.gotoState(powerCard);
|
||||
assertTrue(turnStateMachine1.getState() instanceof PowerCard);
|
||||
|
||||
//sends the turnStatemachine in ChoosePiece
|
||||
PowerCardStateMachine powerCardStateMachine1 = powerCard.getPowerCardStateMachine();
|
||||
powerCardStateMachine1.gotoState(choosePowerCard);
|
||||
assertTrue(powerCardStateMachine1.getState() instanceof ChoosePowerCard);
|
||||
|
||||
//todo send the messages, to force a state change to rollDice
|
||||
|
||||
//tests if the turnStateMachine is in RollDice
|
||||
assertTrue(turnStateMachine1.getState() instanceof RollDice);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -704,7 +728,31 @@ public void testChoosePowerCardToRollDice() {
|
||||
*/
|
||||
@Test
|
||||
public void testChoosePowerCardToSwap() {
|
||||
// Implementation goes here
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in PowerCard
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.gotoState(powerCard);
|
||||
assertTrue(turnStateMachine1.getState() instanceof PowerCard);
|
||||
|
||||
//sends the turnStatemachine in ChoosePiece
|
||||
PowerCardStateMachine powerCardStateMachine1 = powerCard.getPowerCardStateMachine();
|
||||
powerCardStateMachine1.gotoState(choosePowerCard);
|
||||
assertTrue(powerCardStateMachine1.getState() instanceof ChoosePowerCard);
|
||||
|
||||
//todo send the messages, to force a state change to swap
|
||||
|
||||
//tests if the client is in Swap
|
||||
assertTrue(turnStateMachine1.getState() instanceof PowerCard);
|
||||
assertTrue(powerCardStateMachine1.getState() instanceof Swap);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -712,7 +760,31 @@ public void testChoosePowerCardToSwap() {
|
||||
*/
|
||||
@Test
|
||||
public void testChoosePowerCardToShield() {
|
||||
// Implementation goes here
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in PowerCard
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.gotoState(powerCard);
|
||||
assertTrue(turnStateMachine1.getState() instanceof PowerCard);
|
||||
|
||||
//sends the turnStatemachine in ChoosePiece
|
||||
PowerCardStateMachine powerCardStateMachine1 = powerCard.getPowerCardStateMachine();
|
||||
powerCardStateMachine1.gotoState(choosePowerCard);
|
||||
assertTrue(powerCardStateMachine1.getState() instanceof ChoosePowerCard);
|
||||
|
||||
//todo send the messages, to force a state change to shield
|
||||
|
||||
//tests if the client is in Shield
|
||||
assertTrue(turnStateMachine1.getState() instanceof PowerCard);
|
||||
assertTrue(powerCardStateMachine1.getState() instanceof Shield);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -720,7 +792,31 @@ public void testChoosePowerCardToShield() {
|
||||
*/
|
||||
@Test
|
||||
public void testStayInShield() {
|
||||
// Implementation goes here
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in PowerCard
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.gotoState(powerCard);
|
||||
assertTrue(turnStateMachine1.getState() instanceof PowerCard);
|
||||
|
||||
//sends the turnStatemachine in Shield
|
||||
PowerCardStateMachine powerCardStateMachine1 = powerCard.getPowerCardStateMachine();
|
||||
powerCardStateMachine1.gotoState(shield);
|
||||
assertTrue(powerCardStateMachine1.getState() instanceof Shield);
|
||||
|
||||
//todo send the messages, which dont force a statechange
|
||||
|
||||
//tests if the client is in PlayPowerCard
|
||||
assertTrue(turnStateMachine1.getState() instanceof PowerCard);
|
||||
assertTrue(powerCardStateMachine1.getState() instanceof PlayPowerCard);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -728,7 +824,30 @@ public void testStayInShield() {
|
||||
*/
|
||||
@Test
|
||||
public void testShieldToPowerCardEndState() {
|
||||
// Implementation goes here
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in PowerCard
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.gotoState(powerCard);
|
||||
assertTrue(turnStateMachine1.getState() instanceof PowerCard);
|
||||
|
||||
//sends the turnStatemachine in Shield
|
||||
PowerCardStateMachine powerCardStateMachine1 = powerCard.getPowerCardStateMachine();
|
||||
powerCardStateMachine1.gotoState(shield);
|
||||
assertTrue(powerCardStateMachine1.getState() instanceof Shield);
|
||||
|
||||
//todo send the message to force the statechange
|
||||
|
||||
//tests if the client is in PlayPowerCard
|
||||
assertTrue(turnStateMachine1.getState() instanceof PlayPowerCard);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -736,7 +855,30 @@ public void testShieldToPowerCardEndState() {
|
||||
*/
|
||||
@Test
|
||||
public void testSwapToPowerCardEndState() {
|
||||
// Implementation goes here
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in PowerCard
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.gotoState(powerCard);
|
||||
assertTrue(turnStateMachine1.getState() instanceof PowerCard);
|
||||
|
||||
//sends the turnStatemachine in Swap
|
||||
PowerCardStateMachine powerCardStateMachine1 = powerCard.getPowerCardStateMachine();
|
||||
powerCardStateMachine1.gotoState(swap);
|
||||
assertTrue(powerCardStateMachine1.getState() instanceof Swap);
|
||||
|
||||
//todo send the message to force the statechange
|
||||
|
||||
//tests if the client is in PlayPowerCard
|
||||
assertTrue(turnStateMachine1.getState() instanceof PlayPowerCard);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -746,17 +888,17 @@ public void testSwapToPowerCardEndState() {
|
||||
public void testNoPieceInWaitingPiece() {
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.goto(turn);
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in ChoosePiece
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.goto(choosePiece);
|
||||
turnStateMachine1.gotoState(choosePiece);
|
||||
assertTrue(turnStateMachine1.getState() instanceof ChoosePiece);
|
||||
|
||||
//sends the choosePieceStatemachine in NoPiece
|
||||
@@ -778,17 +920,17 @@ public void testNoPieceInWaitingPiece() {
|
||||
public void testNoPieceInSelectedPiece() {
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.goto(turn);
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in ChoosePiece
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.goto(choosePiece);
|
||||
turnStateMachine1.gotoState(choosePiece);
|
||||
assertTrue(turnStateMachine1.getState() instanceof ChoosePiece);
|
||||
|
||||
//sends the choosePieceStatemachine in NoPiece
|
||||
@@ -810,17 +952,17 @@ public void testNoPieceInSelectedPiece() {
|
||||
public void testNoPieceInStartPiece() {
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.goto(turn);
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in ChoosePiece
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.goto(choosePiece);
|
||||
turnStateMachine1.gotoState(choosePiece);
|
||||
assertTrue(turnStateMachine1.getState() instanceof ChoosePiece);
|
||||
|
||||
//sends the choosePieceStatemachine in NoPiece
|
||||
@@ -842,17 +984,17 @@ public void testNoPieceInStartPiece() {
|
||||
public void testNoPieceInWait() {
|
||||
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.goto(turn);
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in ChoosePiece
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.goto(choosePiece);
|
||||
turnStateMachine1.gotoState(choosePiece);
|
||||
assertTrue(turnStateMachine1.getState() instanceof ChoosePiece);
|
||||
|
||||
//sends the choosePieceStatemachine in NoPiece
|
||||
@@ -873,22 +1015,22 @@ public void testNoPieceInWait() {
|
||||
@Test
|
||||
public void testStayInWaitingPiece() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.goto(turn);
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in ChoosePiece
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.goto(choosePiece);
|
||||
turnStateMachine1.gotoState(choosePiece);
|
||||
assertTrue(turnStateMachine1.getState() instanceof ChoosePiece);
|
||||
|
||||
//sends the choosePieceStatemachine in WaitingPiece
|
||||
ChoosePieceStateMachine choosePieceStateMachine1 = choosePiece.getChoosePieceStateMachine();
|
||||
choosePieceStateMachine1.goto(waitingPiece);
|
||||
choosePieceStateMachine1.gotoState(waitingPiece);
|
||||
assertTrue(choosePieceStateMachine1.getState() instanceof WaitingPiece);
|
||||
|
||||
//TODO send all sever-messages except ... to the clientGameLogic to test there are no state change
|
||||
@@ -902,22 +1044,22 @@ public void testStayInWaitingPiece() {
|
||||
@Test
|
||||
public void testWaitingPieceInChoosePieceEndState() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.goto(turn);
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in ChoosePiece
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.goto(choosePiece);
|
||||
turnStateMachine1.gotoState(choosePiece);
|
||||
assertTrue(turnStateMachine1.getState() instanceof ChoosePiece);
|
||||
|
||||
//sends the choosePieceStatemachine in WaitingPiece
|
||||
ChoosePieceStateMachine choosePieceStateMachine1 = choosePiece.getChoosePieceStateMachine();
|
||||
choosePieceStateMachine1.goto(waitingPiece);
|
||||
choosePieceStateMachine1.gotoState(waitingPiece);
|
||||
assertTrue(choosePieceStateMachine1.getState() instanceof WaitingPiece);
|
||||
|
||||
//Todo send the message to the clientGameLogic to force a state change
|
||||
@@ -931,22 +1073,22 @@ public void testWaitingPieceInChoosePieceEndState() {
|
||||
@Test
|
||||
public void testStayInSelectedPiece() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.goto(turn);
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in ChoosePiece
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.goto(choosePiece);
|
||||
turnStateMachine1.gotoState(choosePiece);
|
||||
assertTrue(turnStateMachine1.getState() instanceof ChoosePiece);
|
||||
|
||||
//sends the choosePieceStatemachine in SelectPiece
|
||||
ChoosePieceStateMachine choosePieceStateMachine1 = choosePiece.getChoosePieceStateMachine();
|
||||
choosePieceStateMachine1.goto(selectPiece);
|
||||
choosePieceStateMachine1.gotoState(selectPiece);
|
||||
assertTrue(choosePieceStateMachine1.getState() instanceof SelectPiece);
|
||||
|
||||
//Todo send all server messages which dont force a state change here
|
||||
@@ -960,22 +1102,22 @@ public void testStayInSelectedPiece() {
|
||||
@Test
|
||||
public void testSelectedPieceInChoosePieceEndState() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.goto(turn);
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in ChoosePiece
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.goto(choosePiece);
|
||||
turnStateMachine1.gotoState(choosePiece);
|
||||
assertTrue(turnStateMachine1.getState() instanceof ChoosePiece);
|
||||
|
||||
//sends the choosePieceStatemachine in SelectPiece
|
||||
ChoosePieceStateMachine choosePieceStateMachine1 = choosePiece.getChoosePieceStateMachine();
|
||||
choosePieceStateMachine1.goto(selectPiece);
|
||||
choosePieceStateMachine1.gotoState(selectPiece);
|
||||
assertTrue(choosePieceStateMachine1.getState() instanceof SelectPiece);
|
||||
|
||||
//Todo send the message which force a state change
|
||||
@@ -989,22 +1131,22 @@ public void testSelectedPieceInChoosePieceEndState() {
|
||||
@Test
|
||||
public void testStayInStartPiece() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.goto(turn);
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in ChoosePiece
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.goto(choosePiece);
|
||||
turnStateMachine1.gotoState(choosePiece);
|
||||
assertTrue(turnStateMachine1.getState() instanceof ChoosePiece);
|
||||
|
||||
//sends the choosePieceStatemachine in StartPiece
|
||||
ChoosePieceStateMachine choosePieceStateMachine1 = choosePiece.getChoosePieceStateMachine();
|
||||
choosePieceStateMachine1.goto(startPiece);
|
||||
choosePieceStateMachine1.gotoState(startPiece);
|
||||
assertTrue(choosePieceStateMachine1.getState() instanceof StartPiece);
|
||||
|
||||
//todo send all messages which dont force a state change
|
||||
@@ -1018,22 +1160,22 @@ public void testStayInStartPiece() {
|
||||
@Test
|
||||
public void testStartPieceToChoosePieceEndState() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.goto(gameState);
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
GameStateMachine gameStateMachine1 = gameState.getGameStateMachine();
|
||||
gameStateMachine1.goto(turn);
|
||||
gameStateMachine1.gotoState(turn);
|
||||
assertTrue(gameStateMachine1.getState() instanceof Turn);
|
||||
|
||||
//sends the turnStatemachine in ChoosePiece
|
||||
TurnStateMachine turnStateMachine1 = turn.getTurnStateMachine();
|
||||
turnStateMachine1.goto(choosePiece);
|
||||
turnStateMachine1.gotoState(choosePiece);
|
||||
assertTrue(turnStateMachine1.getState() instanceof ChoosePiece);
|
||||
|
||||
//sends the choosePieceStatemachine in StartPiece
|
||||
ChoosePieceStateMachine choosePieceStateMachine1 = choosePiece.getChoosePieceStateMachine();
|
||||
choosePieceStateMachine1.goto(startPiece);
|
||||
choosePieceStateMachine1.gotoState(startPiece);
|
||||
assertTrue(choosePieceStateMachine1.getState() instanceof StartPiece);
|
||||
|
||||
//Todo send the message which force a state change
|
||||
|
||||
Reference in New Issue
Block a user