public void ProceedAndReturnWithRuntimePolicyOff(ModelBinder.BindModel sut, IAlternateMethodContext context)
        {
            context.Setup(c => c.RuntimePolicyStrategy).Returns(() => RuntimePolicy.Off);

            sut.NewImplementation(context);

            context.Verify(c => c.Proceed());
            context.MessageBroker.Verify(mb => mb.Publish(It.IsAny<object>()), Times.Never());
        }
        public void ProceedPublishMessageWithRuntimePolicyOn(ModelBinder.BindModel sut, IAlternateMethodContext context, ControllerContext arg1, ModelBindingContext arg2)
        {
            context.Setup(c => c.Arguments).Returns(new object[] { arg1, arg2 });

            sut.NewImplementation(context);

            context.TimerStrategy().Verify(t => t.Time(It.IsAny<Action>()));
            context.MessageBroker.Verify(mb => mb.Publish(It.IsAny<ModelBinder.BindModel.Message>()));
        }
        public void ProceedAndPublishMessageWithRuntimePolicyOn(ModelBinder.BindProperty sut, IAlternateMethodContext context, ControllerContext controllerContext, ModelBindingContext modelBindingContext, PropertyDescriptor propertyDescriptor)
        {
            context.Setup(c => c.Arguments).Returns(new object[] { controllerContext, modelBindingContext, propertyDescriptor });

            sut.NewImplementation(context);

            context.TimerStrategy().Verify(c => c.Time(It.IsAny<Action>()));
            context.MessageBroker.Verify(mb => mb.Publish(It.IsAny<ModelBinder.BindProperty.Message>()));
        }