예제 #1
0
        public void default_publish_pipeline_is_fallback()
        {
            var t = new PublishPipelineTester<MessageA>();
            t.TestWith(pp =>
                           {
                               pp.DefaultPublishPipeline(t.Mock1Object, t.Mock3Object);
                               pp.MessageMatch(mi => mi.IsType<MessageB>()).PublishPipeline(t.Mock2Object);
                           });

            t.VerifyCalled(t.Mock1);
            t.VerifyNotCalled(t.Mock2);
            t.VerifyCalled(t.Mock3);
        }
예제 #2
0
 public void Execution_of_pipeline_is_cancellable_by_member()
 {
     var t = new PublishPipelineTester<MessageA>();
     t.Mock1.Setup(pm => pm.LookAt(It.IsAny<PublishToken>())).Callback((PublishToken token) => token.Cancel = true);
     t.TestWith(pp => pp.DefaultPublishPipeline(t.Mock1Object, t.Mock2Object));
     t.VerifyCalled(t.Mock1);
     t.VerifyNotCalled(t.Mock2);
 }
예제 #3
0
        public void non_default_publish_pipeline_takes_precedence()
        {
            var t = new PublishPipelineTester<MessageA>();
            t.TestWith(
                pp =>
                    {
                        pp.DefaultPublishPipeline(t.Mock1Object, t.Mock2Object);
                        pp.MessageMatch(mi => mi.IsType<MessageA>()).PublishPipeline(t.Mock2Object);
                    });

            t.VerifyNotCalled(t.Mock1);
            t.VerifyCalled(t.Mock2);
        }
예제 #4
0
        public void publish_pipeline_is_extensible()
        {
            var t = new PublishPipelineTester<MessageB>();
            t.TestWith(pp => pp.DefaultPublishPipeline(t.Mock1Object, t.Mock2Object));

            t.VerifyCalled(t.Mock1);
            t.VerifyCalled(t.Mock2);
        }