Пример #1
0
        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);
                }
        }
Пример #2
0
        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);
                }
        }
Пример #3
0
        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));
                }
        }
        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_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_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));
            }
        }