예제 #1
0
        public void for_component_subscriptions()
        {
            _subscriptionEvent.Expect(x => x.SubscribedTo <PingMessage>()).Return(() =>
            {
                _unsubscribe();
                return(true);
            });

            _pipeline.ConnectConsumer <TestMessageConsumer <PingMessage> >();

            _subscriptionEvent.VerifyAllExpectations();
        }
예제 #2
0
        public void for_batch_component_subscriptions()
        {
            _subscriptionEvent.Expect(x => x.SubscribedTo <IndividualBatchMessage>()).Return(() =>
            {
                _unsubscribe();
                return(true);
            });

            _pipeline.Subscribe <TestBatchConsumer <IndividualBatchMessage, Guid> >();

            _subscriptionEvent.VerifyAllExpectations();
        }
예제 #3
0
        public void for_batch_subscriptions()
        {
            _subscriptionEvent.Expect(x => x.SubscribedTo <IndividualBatchMessage>()).Return(() =>
            {
                _unsubscribe();
                return(true);
            });

            var consumer = new TestBatchConsumer <IndividualBatchMessage, Guid>();
            var token    = _pipeline.Subscribe(consumer);

            token();

            _subscriptionEvent.VerifyAllExpectations();
            _unsubscribe.AssertWasCalled(x => x());
        }