public void ProceedAndReturnWithRuntimePolicyOff(ActionInvoker.InvokeActionResult <T> sut, IAlternateMethodContext context) { context.Setup(c => c.RuntimePolicyStrategy).Returns(() => RuntimePolicy.Off); sut.NewImplementation(context); context.Verify(c => c.Proceed()); context.MessageBroker.Verify(b => b.Publish(It.IsAny <ActionInvoker.InvokeActionResult <T> .Message>()), Times.Never()); }
public void PublishMessageWithRuntimePolicyOn(ActionInvoker.InvokeActionResult <T> sut, IAlternateMethodContext context) { context.Setup(c => c.Arguments).Returns(new object[] { new ControllerContext { Controller = new DummyAsyncController(), }, new ContentResult() }); sut.NewImplementation(context); context.MessageBroker.Verify(b => b.Publish(It.IsAny <ActionInvoker.InvokeActionResult <T> .Message>())); }