public void Setup() { _validatorDelegate += ObjectValidatorExecutor; _moqValidator = new Mock <IObjectModelValidator>(); _moqValidator.Setup(x => x.Validate(It.IsAny <ActionContext>(), It.IsAny <ValidationStateDictionary>(), It.IsAny <string>(), It.IsAny <object>())) .Callback(_validatorDelegate); }
private void SetupModelValidation() { _objectValidatorDelegate += ObjectValidatorExecutor; var objectValidator = new Mock <IObjectModelValidator>(); objectValidator.Setup(x => x.Validate(It.IsAny <ActionContext>(), It.IsAny <ValidationStateDictionary>(), It.IsAny <string>(), It.IsAny <object>())) .Callback(_objectValidatorDelegate); _testResourceController.ObjectValidator = objectValidator.Object; }