Beispiel #1
0
        public void LocalMessageQueue_SubscriberIgnoresMessages()
        {
            var queue      = new LocalMessageQueue <Int32>();
            var subscriber = new MockMessageSubscriber();

            queue.Subscribe(subscriber, 1);
            queue.Publish(2, null);
            queue.Process();

            TheResultingValue(subscriber.ReceivedMessage).ShouldBe(false);
        }
Beispiel #2
0
        public void LocalMessageQueue_UnsubscribeAllRemovesSubscriber()
        {
            var queue      = new LocalMessageQueue <Int32>();
            var subscriber = new MockMessageSubscriber();

            queue.Subscribe(subscriber, 1);
            queue.Unsubscribe(subscriber);
            queue.Publish(1, null);
            queue.Process();

            TheResultingValue(subscriber.ReceivedMessage).ShouldBe(false);
        }