mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-25 03:29:44 +01:00
Tests bis T071 erweitert
This commit is contained in:
parent
7fce07ac19
commit
7a9e84f49c
@ -564,5 +564,21 @@ public class ServerGameLogicTest {
|
|||||||
verify(playerHandlerMock, never()).releasePlayerFromJail(playerMock);
|
verify(playerHandlerMock, never()).releasePlayerFromJail(playerMock);
|
||||||
verify(gameMock).sendMessage(new JailStayNotification(playerMock));
|
verify(gameMock).sendMessage(new JailStayNotification(playerMock));
|
||||||
}
|
}
|
||||||
}
|
@Test
|
||||||
|
// T071: UC-gameplay-44 - Überprüfen, ob das Rauswürfeln aus dem Gulag fehlschlägt, wenn die Bedingungen nicht erfüllt sind
|
||||||
|
public void testFailRollToExitGulag() {
|
||||||
|
// Spieler versucht, sich aus dem Gulag herauszuwürfeln
|
||||||
|
RollDiceEvent rollDiceEvent = new RollDiceEvent(playerMock);
|
||||||
|
DiceResult diceResult = new DiceResult(3, 5); // Kein Pasch geworfen
|
||||||
|
|
||||||
|
when(playerHandlerMock.getPlayerState(playerMock)).thenReturn(PlayerState.IN_JAIL);
|
||||||
|
when(gameMock.rollDice()).thenReturn(diceResult);
|
||||||
|
|
||||||
|
gameMock.receivedEvent(rollDiceEvent);
|
||||||
|
|
||||||
|
verify(playerHandlerMock, never()).setPlayerState(playerMock, PlayerState.ACTIVE);
|
||||||
|
verify(gameMock).notifyPlayer(playerMock, "Du bist weiterhin im Gulag. Versuche es erneut.");
|
||||||
|
assertEquals("Der Spieler sollte weiterhin im Zustand 'InJail' sein", PlayerState.IN_JAIL, playerHandlerMock.getPlayerState(playerMock));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user