コード例 #1
0
        public static void ShouldNotHaveSubscriptionFor <TMessage>(this IServiceBus bus)
        {
            DateTime giveUpAt = DateTime.Now + Timeout;

            while (DateTime.Now < giveUpAt)
            {
                var inspector = new EndpointSinkLocator(typeof(TMessage));

                bus.OutboundPipeline.Inspect(inspector);

                if (inspector.DestinationAddress == null)
                {
                    return;
                }

                Thread.Sleep(10);
            }

            Assert.Fail("A subscription for " + typeof(TMessage).ToFriendlyName() + " was found on " + bus.Endpoint.Uri);
        }
コード例 #2
0
        public static void ShouldHaveRemoteSubscriptionFor <TMessage>(this IServiceBus bus)
        {
            DateTime giveUpAt = DateTime.Now + Timeout;

            while (DateTime.Now < giveUpAt)
            {
                var inspector = new EndpointSinkLocator(typeof(TMessage));

                bus.OutboundPipeline.Inspect(inspector);

                if (inspector.DestinationAddress != null)
                {
                    return;
                }

                Thread.Sleep(20);
            }

            PipelineViewer.Trace(bus.OutboundPipeline, text => _log.ErrorFormat("Pipeline Inspection Result: " + text));

            Assert.Fail("A subscription for " + typeof(TMessage).ToFriendlyName() + " was not found on " + bus.Endpoint.Address.Uri);
        }