Esempio n. 1
0
        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>()));
        }
Esempio n. 2
0
        public void ProceedAndReturnWithRuntimePolicyOff(ModelBinder.BindProperty 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());
        }