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);
 }
        public void publish_pipeline_is_extensible()
        {
            var t = new PublishPipelineTester<MessageB>();
            t.TestWith(pp => pp.DefaultPublishPipeline(t.Mock1Object, t.Mock2Object));

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

            t.TestWith(pp => pp.DefaultPublishPipeline(t.Mock1Object, t.Mock2Object));

            t.Mock1.VerifyCalled();
            t.Mock2.VerifyCalled();
        }
Exemple #5
0
        public void Execution_of_pipeline_is_cancellable_by_member()
        {
            var t = new PublishPipelineTester <MessageA>();

            t.Mock1.CancelTokenWhenSeen();
            t.TestWith(pp => pp.DefaultPublishPipeline(t.Mock1Object, t.Mock2Object));
            t.Mock1.VerifyCalled();
            t.Mock2.VerifyNotCalled();
        }
        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);
        }
        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);
        }
Exemple #8
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.Mock1.VerifyNotCalled();
            t.Mock2.VerifyCalled();
        }
Exemple #9
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.Mock1.VerifyCalled();
            t.Mock2.VerifyNotCalled();
            t.Mock3.VerifyCalled();
        }