Example #1
0
        public InboundMessageInterceptor Create(IInboundMessageInterceptor messageInterceptor)
        {
            var scope = new InboundMessageInterceptorConfiguratorScope();

            _sink.Inspect(scope);

            return(ConfigureInterceptor(scope.InsertAfter, messageInterceptor));
        }
Example #2
0
        public static IEnumerable <IPipelineSink <TMessage> > ShouldHaveSubscriptionFor <TMessage>(this IInboundMessagePipeline pipeline)
            where TMessage : class
        {
            DateTime giveUpAt = DateTime.Now + Timeout;

            while (DateTime.Now < giveUpAt)
            {
                var inspector = new PipelineSinkLocator <TMessage>();

                pipeline.Inspect(inspector);

                if (inspector.Result.Count() > 0)
                {
                    return(inspector.Result);
                }

                Thread.Sleep(20);
            }

            Assert.Fail("A subscription for " + typeof(TMessage).ToFriendlyName() + " was not found on the pipeline");

            return(null);
        }