Exemplo n.º 1
0
        public void for_component_subscriptions()
        {
            _subscriptionEvent.Expect(x => x.SubscribedTo <PingMessage>()).Return(() =>
            {
                _unsubscribe();
                return(true);
            });

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

            _subscriptionEvent.VerifyAllExpectations();
        }
Exemplo n.º 2
0
        public void A_component_should_be_subscribed_to_the_pipeline()
        {
            var consumer = new TestMessageConsumer <PingMessage>();

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

            PipelineViewer.Trace(_pipeline);

            var message = new PingMessage();

            _pipeline.ShouldHaveSubscriptionFor <PingMessage>();

            _pipeline.Dispatch(message);

            TestMessageConsumer <PingMessage> .AnyShouldHaveReceivedMessage(message, 1.Seconds());
        }