edted some tests with null tests

This commit is contained in:
Benjamin Feyer
2024-11-25 16:32:51 +01:00
committed by Felix
parent e18ea15efa
commit 9859d52e02

View File

@@ -13,6 +13,8 @@
import java.util.ArrayList;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
/**
@@ -131,12 +133,12 @@ public void setUp() {
lobbyDeny = new LobbyDeny();
lobbyPlayerJoin = new LobbyPlayerJoin(name);
lobbyPlayerLeave = new LobbyPlayerLeave(name,color);
moveMessage = new MoveMessage();
moveMessage = new MoveMessage("www");//Todo
noTurn = new NoTurn();
pauseGame = new PauseGame();
playCardSwap = new PlayCard(swapCard);
playCardShield = new PlayCard(shieldCard);
playCardTurbo = new PlayCard(turboCard);
playCardSwap = new PlayCard(swapCard,"www");//Todo
playCardShield = new PlayCard(shieldCard,"www");//Todo
playCardTurbo = new PlayCard(turboCard,"www");//Todo
possibleCard = new PossibleCard();
possiblePiece = new PossiblePiece();
rankingResponce = new RankingResponse();
@@ -144,9 +146,9 @@ public void setUp() {
reconnectBriefing = new ReconnectBriefing(game);
resumeGame = new ResumeGame();
startGame = new ServerStartGame();
startPieceMessage = new StartPiece();
updateReady = new UpdateReady();
updateTSK = new UpdateTSK();
startPieceMessage = new StartPiece(); //Todo wrong class
updateReady = new UpdateReady(color,true);
updateTSK = new UpdateTSK(name,color);
waitPiece = new WaitPiece();
//initialize the clientGameLogic
@@ -162,7 +164,7 @@ public void send(ClientMessage msg) {
mainSettings = new MainSettings(settingsStateMachine,clientGameLogic);
videoSettings = new VideoSettings(settingsStateMachine,clientGameLogic);
audioSettings = new AudioSettings(settingsStateMachine,clientGameLogic);
settings = new Settings();
settings = new Settings(clientAutomaton,clientGameLogic);
//initialize the stateMachines
@@ -220,10 +222,12 @@ public void send(ClientMessage msg) {
@Test
public void testInitialStateClientState() {
//tests if the clientAutomaton is in Dialogs
assertNotEquals(clientAutomaton.getState() , null);
assertTrue(clientAutomaton.getState() instanceof Dialogs);
Dialogs dialogs = (Dialogs) clientAutomaton.getState();
DialogsStateMachine dialogsStateMachine1 = dialogs.getDialogsStateMachine();
//tests if the statemachine is in StartDialog
assertNotEquals(dialogsStateMachine1.getState(), null);
assertTrue(dialogsStateMachine1.getState() instanceof StartDialog);
}
@@ -603,7 +607,7 @@ public void testWaitToAnimation() {
assertTrue(gameStateMachine.getState() instanceof Waiting);
//tests if a powerCard is played,that the client goes into Animation
clientGameLogic.receive(playCard); //Todo ??? richtige message
clientGameLogic.receive(playCardTurbo); //Todo ??? richtige message
assertTrue(clientAutomaton.getState() instanceof GameState);
assertTrue(gameStateMachine.getState() instanceof Animation);