public void registers_a_CurrentChain_service_for_diagnostic_purposes()
        {
            var chain   = new HandlerChain();
            var context = new FubuTransportation.Runtime.Invocation.InvocationContext(ObjectMother.EnvelopeWithMessage(), chain);

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

            messages.OutgoingMessages().Any().ShouldBeFalse();
        }
        public void registers_a_CurrentChain_service_for_diagnostic_purposes()
        {
            var chain = new HandlerChain();
            var context = new FubuTransportation.Runtime.Invocation.InvocationContext(ObjectMother.EnvelopeWithMessage(), chain);

            context.Get<ICurrentChain>().Current.ShouldBeTheSameAs(chain);
        }
        public void SetUp()
        {
            theEnvelope = new Envelope {
                Message = new Message2()
            };

            theArgs = new FubuTransportation.Runtime.Invocation.InvocationContext(theEnvelope, new HandlerChain());
        }
        public IActionBehavior BuildBehavior(ServiceArguments arguments, Guid behaviorId)
        {
            Arguments = arguments.ShouldBeOfType <FubuTransportation.Runtime.Invocation.InvocationContext>();
            _cascadingMessages.Each(x => Arguments.EnqueueCascading(x));

            _chain.UniqueId.ShouldEqual(behaviorId);

            return(_behavior);
        }
        public void ignores_nulls_just_fine()
        {
            var messages = new FubuTransportation.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 FubuTransportation.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);
        }
        public void enqueue_an_oject_array()
        {
            var messages = new FubuTransportation.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);
        }
Example #9
0
        protected override void theContextIs()
        {
            theBehavior = MockFor <IDisposableBehavior>();
            theChain    = new HandlerChain();

            _invocationContext = new FubuTransportation.Runtime.Invocation.InvocationContext(theEnvelope, new HandlerChain());

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



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

            theContinuationContext = new TestContinuationContext();

            theContext = new FubuTransportation.Runtime.Invocation.InvocationContext(theEnvelope, new HandlerChain());
            theContext.EnqueueCascading(new object());

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

            theContinuationContext = new TestContinuationContext();

            theContext = new FubuTransportation.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, theContinuationContext);
        }
        public void SetUp()
        {
            theEnvelope         = ObjectMother.Envelope();
            theEnvelope.Message = new object();

            theContinuationContext = new TestContinuationContext();

            theContext = new FubuTransportation.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, theContinuationContext);
        }
        public void SetUp()
        {
            theEnvelope = new Envelope{Message = new Message2()};

            theArgs = new FubuTransportation.Runtime.Invocation.InvocationContext(theEnvelope, new HandlerChain());
        }
 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);

            theContinuationContext = new TestContinuationContext();

            theContext = new FubuTransportation.Runtime.Invocation.InvocationContext(theEnvelope, new HandlerChain());
            theContext.EnqueueCascading(new object());

            theContinuation = new ChainSuccessContinuation(theContext);
            theContinuation.Execute(theEnvelope, theContinuationContext);
        }