public UnsubscribeAction SubscribedTo <T>(Uri endpointUri)
            where T : class
        {
            if (endpointUri == _bus.Endpoint.Uri)
            {
                return(() => true);
            }

            IEndpoint endpoint = _endpointFactory.GetEndpoint(endpointUri);

            return(_pipeline.Subscribe <T>(endpoint));
        }
        public void A_batch_component_should_be_delivered_messages()
        {
            var consumer = new TestBatchConsumer <IndividualBatchMessage, Guid>();

            _builder.Stub(x => x.GetInstance <TestBatchConsumer <IndividualBatchMessage, Guid> >()).Return(consumer);

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

            PublishBatch(_pipeline, 1);

            TimeSpan _timeout = 5.Seconds();

            TestBatchConsumer <IndividualBatchMessage, Guid> .AnyShouldHaveReceivedBatch(_batchId, _timeout);
        }
 public UnsubscribeAction SubscribedTo <T>()
     where T : class
 {
     return(_outbound.Subscribe <T>(_localEndpoint));
 }