public void TrimmedReceivedDataWhenStartShouldContainReceivedMessage() { MockSocketCommunication mockSocket = new MockSocketCommunication(); ChatServerSide server = new ChatServerSide(mockSocket); mockSocket.TextToReceive = "testUser<sep>testMessage<sep>lastMessageReceived<eof>"; server.Start(); Assert.Equal("testUser<sep>testMessage<sep>lastMessageReceived<eof>", mockSocket.TrimmedReceivedData); }
public void StartWhenNotNullSocketShouldWaitForIncomingConnection() { MockSocketCommunication mockSocket = new MockSocketCommunication(); ChatServerSide server = new ChatServerSide(mockSocket); mockSocket.TextToReceive = "testUser<sep>testMessage<sep>lastMessageReceived<eof>"; server.Start(); Assert.True(mockSocket.ServerIsWaiting); }
public void StartWhenNullSocketShouldThrowException() { ChatServerSide server = new ChatServerSide(null); Assert.Throws <ArgumentNullException>(() => server.Start()); }