public void ProceedAndPublishMessagesWithRuntimePolicyOn(ResultExecutedContext argument, IAlternateMethodContext context) { context.Setup(c => c.Arguments).Returns(new object[] { argument }); var sut = new ResultFilter.OnResultExecuted(); sut.NewImplementation(context); context.TimerStrategy().Verify(t => t.Time(It.IsAny<Action>())); context.MessageBroker.Verify(mb => mb.Publish(It.IsAny<ResultFilter.OnResultExecuted.Message>())); }
public void ProceedAndReturnWithRuntimePolicyOff(IAlternateMethodContext context) { context.Setup(c => c.RuntimePolicyStrategy).Returns(() => RuntimePolicy.Off); var sut = new ResultFilter.OnResultExecuted(); sut.NewImplementation(context); context.Verify(c => c.Proceed()); context.MessageBroker.Verify(mb => mb.Publish(It.IsAny<MessageBase>()), Times.Never()); }
public void ProceedAndPublishMessagesWithRuntimePolicyOn(ResultExecutedContext argument, IAlternateMethodContext context) { context.Setup(c => c.Arguments).Returns(new object[] { argument }); var sut = new ResultFilter.OnResultExecuted(); sut.NewImplementation(context); context.TimerStrategy().Verify(t => t.Time(It.IsAny <Action>())); context.MessageBroker.Verify(mb => mb.Publish(It.IsAny <ResultFilter.OnResultExecuted.Message>())); }
public void ProceedAndReturnWithRuntimePolicyOff(IAlternateMethodContext context) { context.Setup(c => c.RuntimePolicyStrategy).Returns(() => RuntimePolicy.Off); var sut = new ResultFilter.OnResultExecuted(); sut.NewImplementation(context); context.Verify(c => c.Proceed()); context.MessageBroker.Verify(mb => mb.Publish(It.IsAny <MessageBase>()), Times.Never()); }
public void ImplementProperMethod() { var sut = new ResultFilter.OnResultExecuted(); Assert.Equal("OnResultExecuted", sut.MethodToImplement.Name); }