ClientTests ReceiveCallback Method Delta Engine Documentation

Namespace: DeltaEngine.Networking.Tests
Assembly: DeltaEngine.Networking.Tests (in DeltaEngine.Networking.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void ReceiveCallback()
Examples

[Test]
public void ReceiveCallback()
{
    var server = new MockServer();
    using (var client = new MockClient(server))
    {
        client.Connect("localhost", 1);
        bool messageReceived = false;
        client.DataReceived += message => messageReceived = true;
        server.SendToAllClients(new TextMessage("Doesn't matter"));
        Assert.IsTrue(messageReceived);
    }
}
See Also