ClientTests ClientIsDisconnected 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 ClientIsDisconnected()
Examples

[Test]
public void ClientIsDisconnected()
{
    var server = new MockServer();
    var client = new MockClient(server);
    bool isConnected = false;
    client.Connected += () => isConnected = true;
    client.Disconnected += () => isConnected = false;
    client.Connect("localhost", 1);
    Assert.IsTrue(isConnected);
    client.Dispose();
    Assert.IsFalse(isConnected);
}
See Also