Inheritance: TypeArguments, IInvocationContext
        public void registers_a_CurrentChain_service_for_diagnostic_purposes()
        {
            var chain = new HandlerChain();
            var context = new FubuMVC.Core.ServiceBus.Runtime.Invocation.InvocationContext(ObjectMother.EnvelopeWithMessage(), chain);

            context.Get<ICurrentChain>().Current.ShouldBeTheSameAs(chain);
        }
Exemple #2
0
        public void registers_a_CurrentChain_service_for_diagnostic_purposes()
        {
            var chain   = new HandlerChain();
            var context = new FubuMVC.Core.ServiceBus.Runtime.Invocation.InvocationContext(ObjectMother.EnvelopeWithMessage(), chain);

            context.Get <ICurrentChain>().Current.ShouldBeTheSameAs(chain);
        }
        public void ignores_nulls_just_fine()
        {
            var messages = new FubuMVC.Core.ServiceBus.Runtime.Invocation.InvocationContext(new Envelope { Message = new Message1() }, new HandlerChain());
            messages.EnqueueCascading(null);

            messages.OutgoingMessages().Any().ShouldBeFalse();
        }
Exemple #4
0
        public void SetUp()
        {
            theEnvelope = new Envelope {
                Message = new Message2()
            };

            theArgs = new FubuMVC.Core.ServiceBus.Runtime.Invocation.InvocationContext(theEnvelope, new HandlerChain());
        }
Exemple #5
0
        public void ignores_nulls_just_fine()
        {
            var messages = new FubuMVC.Core.ServiceBus.Runtime.Invocation.InvocationContext(new Envelope {
                Message = new Message1()
            }, new HandlerChain());

            messages.EnqueueCascading(null);

            messages.OutgoingMessages().Any().ShouldBeFalse();
        }
        public void enqueue_an_oject_array()
        {
            var messages = new FubuMVC.Core.ServiceBus.Runtime.Invocation.InvocationContext(new Envelope{Message = new Message1()}, new HandlerChain());
            var m1 = new Message1();
            var m2 = new Message2();

            messages.EnqueueCascading(new object[]{m1, m2});

            messages.OutgoingMessages().ShouldHaveTheSameElementsAs(m1, m2);
        }
Exemple #7
0
        public void enqueue_an_oject_array()
        {
            var messages = new FubuMVC.Core.ServiceBus.Runtime.Invocation.InvocationContext(new Envelope {
                Message = new Message1()
            }, new HandlerChain());
            var m1 = new Message1();
            var m2 = new Message2();

            messages.EnqueueCascading(new object[] { m1, m2 });

            messages.OutgoingMessages().ShouldHaveTheSameElementsAs(m1, m2);
        }
        protected override void theContextIs()
        {
            theBehavior = MockFor <IDisposableBehavior>();
            theChain    = new HandlerChain();

            _invocationContext = new FubuMVC.Core.ServiceBus.Runtime.Invocation.InvocationContext(theEnvelope, new HandlerChain());

            MockFor <IServiceFactory>().Stub(x => x.BuildBehavior(_invocationContext, theChain.UniqueId))
            .Return(theBehavior);

            Services.Inject(new BehaviorGraph());

            ClassUnderTest.ExecuteChain(theEnvelope, theChain);
        }
Exemple #9
0
        public void SetUp()
        {
            theEnvelope         = ObjectMother.Envelope();
            theEnvelope.Message = new object();
            theException        = new Exception("Failure");
            theEnvelope.Callback.Stub(x => x.MarkSuccessful()).Throw(theException);

            theEnvelopeContext = new TestEnvelopeContext();

            theContext = new FubuMVC.Core.ServiceBus.Runtime.Invocation.InvocationContext(theEnvelope, new HandlerChain());
            theContext.EnqueueCascading(new object());

            theContinuation = new ChainSuccessContinuation(theContext);
            theContinuation.Execute(theEnvelope, theEnvelopeContext);
        }
        public void SetUp()
        {
            theEnvelope = ObjectMother.Envelope();
            theEnvelope.Message = new object();

            theEnvelopeContext = new TestEnvelopeContext();

            theContext = new FubuMVC.Core.ServiceBus.Runtime.Invocation.InvocationContext(theEnvelope, new HandlerChain());

            theContext.EnqueueCascading(new object());
            theContext.EnqueueCascading(new object());
            theContext.EnqueueCascading(new object());

            theSender = new RecordingEnvelopeSender();

            theContinuation = new ChainSuccessContinuation(theContext);

            theLogger = new RecordingLogger();

            theContinuation.Execute(theEnvelope, theEnvelopeContext);
        }
Exemple #11
0
        public void SetUp()
        {
            theEnvelope         = ObjectMother.Envelope();
            theEnvelope.Message = new object();

            theEnvelopeContext = new TestEnvelopeContext();

            theContext = new FubuMVC.Core.ServiceBus.Runtime.Invocation.InvocationContext(theEnvelope, new HandlerChain());

            theContext.EnqueueCascading(new object());
            theContext.EnqueueCascading(new object());
            theContext.EnqueueCascading(new object());

            theSender = new RecordingEnvelopeSender();

            theContinuation = new ChainSuccessContinuation(theContext);

            theLogger = new RecordingLogger();

            theContinuation.Execute(theEnvelope, theEnvelopeContext);
        }
 protected bool Equals(InvocationContext other)
 {
     return Equals(_envelope, other._envelope);
 }
        public void SetUp()
        {
            theEnvelope = ObjectMother.Envelope();
            theEnvelope.Message = new object();
            theException = new Exception("Failure");
            theEnvelope.Callback.Stub(x => x.MarkSuccessful()).Throw(theException);

            theEnvelopeContext = new TestEnvelopeContext();

            theContext = new FubuMVC.Core.ServiceBus.Runtime.Invocation.InvocationContext(theEnvelope, new HandlerChain());
            theContext.EnqueueCascading(new object());

            theContinuation = new ChainSuccessContinuation(theContext);
            theContinuation.Execute(theEnvelope, theEnvelopeContext);
        }
        public void SetUp()
        {
            theEnvelope = new Envelope{Message = new Message2()};

            theArgs = new FubuMVC.Core.ServiceBus.Runtime.Invocation.InvocationContext(theEnvelope, new HandlerChain());
        }