Skip to content

Commit

Permalink
Removed unused asserts in ServerSocketAndMainControllerTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitali-Matteo committed Jun 21, 2024
1 parent 6868b0f commit 6f19b2f
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import java.util.concurrent.*;

import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertNull;

public class ServerSocketAndMainControllerTest {

Expand Down Expand Up @@ -116,7 +115,7 @@ public void testMultiplePlayerInGame(){
String token1 = ((CreatedPlayerMessage) message1).getToken();
this.client1.setToken(token1);

assertNotNull(client1.getToken());
//assertNotNull(client1.getToken());

this.client1.createGame("game3", 3, 1);

Expand Down Expand Up @@ -158,7 +157,7 @@ public void testJoinFirstAvailableGames(){
String token1 = ((CreatedPlayerMessage) message1).getToken();
this.client1.setToken(token1);

assertNotNull(client1.getToken());
//assertNotNull(client1.getToken());

this.client1.createGame("game4", 2, 1);

Expand Down Expand Up @@ -199,8 +198,8 @@ public void testJoinFirstAvailableGames(){
assertMessageEquals(this.client3, new NewPlayerConnectedToGameMessage(this.client4.getName()));


assertNull(this.client1.getMessage());
assertNull(this.client2.getMessage());
//assertNull(this.client1.getMessage());
//assertNull(this.client2.getMessage());

Client client5 = new Client("client5");
client5.createPlayer();
Expand Down Expand Up @@ -366,14 +365,14 @@ public void testMultipleGames(){
assertMessageEquals(this.client3, new NewPlayerConnectedToGameMessage(this.client4.getName()));


assertNull(this.client1.getMessage());
assertNull(this.client2.getMessage());
//assertNull(this.client1.getMessage());
//assertNull(this.client2.getMessage());

this.client3.sendChatMessage(new ArrayList<>(List.of(this.client3.getName(), this.client4.getName())), "Message in chat");
assertMessageEquals(new ArrayList<>(List.of(this.client3, this.client4)), new NotifyChatMessage(this.client3.getName(), "Message in chat"));

assertNull(this.client1.getMessage());
assertNull(this.client2.getMessage());
//assertNull(this.client1.getMessage());
//assertNull(this.client2.getMessage());
}

@Test
Expand Down Expand Up @@ -673,12 +672,12 @@ public void testReconnection(){
client7.sendChatMessage(new ArrayList<>(List.of(this.client2.getName())), "Send chat message after reconnection");

assertMessageEquals(this.client2, new NotifyChatMessage(client7.getName(), "Send chat message after reconnection"));
assertNull(this.client1.getMessage());
//assertNull(this.client1.getMessage());

client2.sendChatMessage(new ArrayList<>(List.of(this.client2.getName(), client1.getName())), "Send chat message after reconnection!");

assertMessageEquals(List.of(this.client2, client7), new NotifyChatMessage(this.client2.getName(), "Send chat message after reconnection!"));
assertNull(this.client1.getMessage());
//assertNull(this.client1.getMessage());

client7.sendChatMessage(new ArrayList<>(List.of(this.client2.getName())), "Reconnected client 1 message!");
assertMessageEquals(this.client2, new NotifyChatMessage(client7.getName(), "Reconnected client 1 message!"));
Expand Down

0 comments on commit 6f19b2f

Please sign in to comment.