OnlineServiceConnectionTests ConnectToInvalidServerShouldTimeOut 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 ConnectToInvalidServerShouldTimeOut()
Examples

[Test]
public void ConnectToInvalidServerShouldTimeOut()
{
    bool timedOut = false;
    var connection = new OnlineServiceConnection();
    connection.Connect("localhost", 12345, () => timedOut = true);
    Thread.Sleep((int)((connection.Timeout + 0.5f) * 1000));
    Assert.IsTrue(timedOut);
    Assert.IsFalse(connection.IsLoggedIn);
}
See Also