public void Subscriber_Disconnect_doesnt_hang(RedFoxTransport transport) { using (var publisher = new Publisher()) using (var subscriber = new TestSubscriber()) { var endpoint = TestHelpers.CreateEndpointForTransport(transport); publisher.Bind(endpoint); subscriber.Connect(endpoint); subscriber.Disconnect(true, Timeout); } }
public void Subscriber_IsDisconnected_should_be_true_when_disconnected(RedFoxTransport transport) { using (var publisher = new Publisher()) using (var subscriber = new TestSubscriber()) { var endpoint = TestHelpers.CreateEndpointForTransport(transport); publisher.Bind(endpoint); subscriber.Connect(endpoint); subscriber.Disconnect(); Assert.IsTrue(subscriber.IsDisconnected); } }
public void Subscriber_Disconnected_event_fires(RedFoxTransport transport) { using (var publisher = new Publisher()) using (var subscriber = new TestSubscriber()) { var endpoint = TestHelpers.CreateEndpointForTransport(transport); var eventFired = new ManualResetEventSlim(); publisher.Bind(endpoint); subscriber.Disconnected += eventFired.Set; subscriber.Connect(endpoint); subscriber.Disconnect(); Assert.IsTrue(eventFired.Wait(Timeout)); } }