public void AssertPairIsDisconnected() { //Some disconnection subroutine could be asynchronous. TestTools.AssertTrue(() => !ProxyConnection.Channel.IsConnected, 1000, "Client connection has to be disconnected"); TestTools.AssertTrue(() => !OriginConnection.Channel.IsConnected, 1000, "Server connection has to be disconnected"); TestTools.AssertTrue(() => !Server.GetAllConnections().Any(), 1000, "Server connections list has to be empty"); TestTools.AssertTrue(() => Server.IsListening, 1000, "Server has to continue listening"); /* * Assert.IsFalse(ProxyConnection.Channel.IsConnected, "Client connection has to be disconnected"); * Assert.IsFalse(OriginConnection.Channel.IsConnected, "Server connection has to be disconnected"); * Assert.AreEqual(0, Server.GetAllConnections().Count(), "Server connections list has to be empty"); * Assert.IsTrue(Server.IsListening, "Server has to continue listening");*/ }