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 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(); }
public void SetUp() { theEnvelope = new Envelope { Message = new Message2() }; theArgs = new FubuMVC.Core.ServiceBus.Runtime.Invocation.InvocationContext(theEnvelope, new HandlerChain()); }
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); }
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); }
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); }
protected bool Equals(InvocationContext other) { return Equals(_envelope, other._envelope); }
public void SetUp() { theEnvelope = new Envelope{Message = new Message2()}; theArgs = new FubuMVC.Core.ServiceBus.Runtime.Invocation.InvocationContext(theEnvelope, new HandlerChain()); }