public void is_async_positive() { var chain = new HandlerChain(); chain.IsAsync.ShouldBeFalse(); chain.AddToEnd(HandlerCall.For<GreenHandler>(x => x.Handle(new Message1()))); chain.AddToEnd(HandlerCall.For<AsyncHandler>(x => x.Go(null))); chain.IsAsync.ShouldBeTrue(); }
public void is_async_positive() { var chain = new HandlerChain(); chain.IsAsync.ShouldBeFalse(); chain.AddToEnd(HandlerCall.For <GreenHandler>(x => x.Handle(new Message1()))); chain.AddToEnd(HandlerCall.For <AsyncHandler>(x => x.Go(null))); chain.IsAsync.ShouldBeTrue(); }
public void is_saga_chain_is_true_for_handler_chain_with_a_saga_handler() { var call = HandlerCall.For<SimpleSagaHandler>(x => x.Last(null)); var chain = new HandlerChain(); chain.AddToEnd(call); StatefulSagaConvention.IsSagaChain(chain) .ShouldBeTrue(); }
public void is_saga_chain_is_false_for_handler_chain_with_no_saga_handlers() { var call = HandlerCall.For<SimpleHandler<OneMessage>>(x => x.Handle(null)); var chain = new HandlerChain(); chain.AddToEnd(call); StatefulSagaConvention.IsSagaChain(chain) .ShouldBeFalse(); }
protected override void beforeEach() { theEnvelope = ObjectMother.Envelope(); theInvoker = MockFor <IChainInvoker>(); theChain = new HandlerChain(); theChain.AddToEnd(HandlerCall.For <TaskHandler>(x => x.AsyncHandle(null))); theChain.IsAsync.ShouldBeTrue(); theInvoker.Stub(x => x.FindChain(theEnvelope)) .Return(theChain); theContinuation = ClassUnderTest.Handle(theEnvelope); }
public void AddClone(HandlerChain chain) { chain.AddToEnd(Clone()); }