Browse Source

test_ClientHandlerConstructorTest

remotes/origin/client-handler
Valentin Spiroski 11 months ago
parent
commit
c97d9b0d47
  1. 27
      src/test/java/ClientHandlerConstructorTest.java

27
src/test/java/ClientHandlerConstructorTest.java

@ -0,0 +1,27 @@
import static org.junit.Assert.*;
import org.junit.Test;
import java.io.*;
import java.net.*;
public class ClientHandlerConstructorTest {
@Test
public void testConstructor() {
Socket mockSocket = new Socket();
int port = 12345;
ChatServer mockChatServer = new ChatServer(port);
ClientHandler clientHandler = new ClientHandler(mockChatServer, mockSocket);
assertTrue(mockChatServer.getClients().contains(clientHandler));
}
}
Loading…
Cancel
Save