edited a test in the clientStateTest

This commit is contained in:
Benjamin Feyer
2024-11-24 16:03:12 +01:00
committed by Felix
parent 227d4286e5
commit 3c97cdae38

View File

@@ -414,7 +414,28 @@ public void testStayInLobby() {
*/
@Test
public void testLobbyToRollRankingDice() {
// Implementation goes here
//sends the clientStatemachine in Lobby
assertTrue(clientAutomaton.getState() instanceof Dialogs);
Dialogs dialogs1 = (Dialogs) clientAutomaton.getState();
DialogsStateMachine dialogsStateMachine1 = lobby.getDialogsStatemachine();
dialogsStateMachine1.goto(lobby);
assertTrue(dialogsStateMachine1.getState() instanceof Lobby);
//sends the message to start the game
clientGameLogic.receive();//TODO message
//tests if the clientStateMachine is in the GameState
assertTrue(clientAutomaton.getState() instanceof GameState);
//tests if the clientStateMachine is in the DetermineStartPlayer
GameState gameState1 = (GameState) clientAutomaton.getState();
GameStateMachine gameStateMachine1 = gameState1.getgameSatateMachine();
assertTrue(gameStateMachine1.getState() instanceof DetermineStartPlayer);
//tests if the clientStateMachine is in the RollRankingDice
DetermineStartPlayer determineStartPlayer1 = (DetermineStartPlayer) gameStateMachine1.getState();
DetermineStartPlayerStateMachine determineStartPlayerStateMachine1 = gameStateMachine1.getDetermineStartPlayerMachine();
assertTrue(determineStartPlayerStateMachine1.getState() instanceof RollRankingDice);
}
/**