public void Test_IsConnected_Variation_4() { using var server = new TestServer(ServiceName); server.Register(); using var client = new DdeClient(ServiceName, TopicName); var listener = new EventListener(); client.Disconnected += listener.OnEvent; client.Connect(); server.Disconnect(); Assert.IsTrue(listener.Received.WaitOne(Timeout, false)); Assert.IsFalse(client.IsConnected); }
public void Test_Disconnected_Variation_2() { using var server = new TestServer(ServiceName); server.Register(); using var client = new DdeClient(ServiceName, TopicName); var listener = new EventListener(); client.Disconnected += listener.OnEvent; client.Connect(); server.Disconnect(); Assert.IsTrue(listener.Received.WaitOne(Timeout, false)); var args = (DdeDisconnectedEventArgs) listener.Events[0]; Assert.IsTrue(args.IsServerInitiated); Assert.IsFalse(args.IsDisposed); }
public void Test_IsConnected_Variation_4() { using (TestServer server = new TestServer(ServiceName)) { server.Register(); using (DdeClient client = new DdeClient(ServiceName, TopicName)) { EventListener listener = new EventListener(); client.Disconnected += listener.OnEvent; client.Connect(); server.Disconnect(); Assert.IsTrue(listener.Received.WaitOne(Timeout, false)); Assert.IsFalse(client.IsConnected); } } }
public void Test_Disconnected_Variation_2() { using (TestServer server = new TestServer(ServiceName)) { server.Register(); using (DdeClient client = new DdeClient(ServiceName, TopicName)) { EventListener listener = new EventListener(); client.Disconnected += listener.OnEvent; client.Connect(); server.Disconnect(); Assert.IsTrue(listener.Received.WaitOne(Timeout, false)); DdeDisconnectedEventArgs args = (DdeDisconnectedEventArgs)listener.Events[0]; Assert.IsTrue(args.IsServerInitiated); Assert.IsFalse(args.IsDisposed); } } }