diff --git a/src/test/java/ClientHandlerConstructorTest.java b/src/test/java/ClientHandlerConstructorTest.java new file mode 100644 index 0000000..7ebe7ce --- /dev/null +++ b/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)); + } +}