public void InvokeBehavior(IBuilder builder) { var runner = new UnitOfWorkBehavior(); var context = new IncomingContext(new RootContext(builder), new TransportMessage()); runner.Invoke(context, () => { }); }
public void InvokeBehavior(IBuilder builder) { var runner = new UnitOfWorkBehavior(); var context = new ReceivePhysicalMessageContext(new RootContext(builder), new TransportMessage(), false); runner.Invoke(context, () => { }); }
public void InvokeBehavior(IBuilder builder) { var runner = new UnitOfWorkBehavior(); using (var context = new BehaviorContext(builder, new TransportMessage(), new BehaviorContextStacker())) { runner.Invoke(context, () => { }); } }
static Task InvokeBehavior(FakeBuilder builder, Exception toThrow = null) { var runner = new UnitOfWorkBehavior(); var context = new TestableIncomingPhysicalMessageContext(); context.Builder = builder; return(runner.Invoke(context, ctx => { if (toThrow != null) { throw toThrow; } return TaskEx.CompletedTask; })); }
static Task InvokeBehavior(FakeBuilder builder, Exception toThrow = null, bool hasUnitsOfWork = true) { var runner = new UnitOfWorkBehavior(hasUnitsOfWork); var context = new TestableIncomingPhysicalMessageContext(); context.Builder = builder; return runner.Invoke(context, ctx => { if (toThrow != null) { throw toThrow; } return TaskEx.CompletedTask; }); }
public Task Invoke() { return(UnitOfWorkBehavior.Invoke(Context, NextTask.Object)); }