Exemplo n.º 1
0
 public void SendTestMessageWithoutServerShouldNotCrash()
 {
     using (var client = new ClientMock(null))
     {
         Assert.IsFalse(client.IsConnected);
         client.Send(new TestMessage(""));
     }
 }
Exemplo n.º 2
0
 public void ConnectToServer()
 {
     var server = new ServerMock();
     using (var client = new ClientMock(server))
     {
         Assert.IsTrue(client.IsConnected);
     }
 }
Exemplo n.º 3
0
 public void ReceiveCallback()
 {
     var server = new ServerMock();
     using (var client = new ClientMock(server))
     {
         bool eventTriggered = false;
         client.DataReceived += (clientConnection, binaryData) => eventTriggered = true;
         client.Receive();
         Assert.IsTrue(eventTriggered);
     }
 }