示例#1
0
        public void SetUp()
        {
            _collectorStub1 = MockRepository.GenerateStub <IComponentValidationCollector>();
            _collectorStub2 = MockRepository.GenerateStub <IComponentValidationCollector>();

            _propertyMetaValidationRuleStub1 = MockRepository.GenerateStub <IAddingComponentPropertyMetaValidationRule>();
            _propertyMetaValidationRuleStub2 = MockRepository.GenerateStub <IAddingComponentPropertyMetaValidationRule>();
            _propertyMetaValidationRuleStub3 = MockRepository.GenerateStub <IAddingComponentPropertyMetaValidationRule>();

            _collectorStub1.Stub(stub => stub.AddedPropertyMetaValidationRules)
            .Return(new[] { _propertyMetaValidationRuleStub1, _propertyMetaValidationRuleStub2 });
            _collectorStub2.Stub(stub => stub.AddedPropertyMetaValidationRules).Return(new[] { _propertyMetaValidationRuleStub3 });

            _propertyValidatorStub1 = MockRepository.GenerateStub <IPropertyValidator>();
            _propertyValidatorStub2 = MockRepository.GenerateStub <IPropertyValidator>();
            _propertyValidatorStub3 = MockRepository.GenerateStub <IPropertyValidator>();
            _propertyValidatorStub4 = MockRepository.GenerateStub <IPropertyValidator>();
            _propertyValidatorStub5 = MockRepository.GenerateStub <IPropertyValidator>();

            _systemMetaRulesProviderFactoryStub = MockRepository.GenerateStub <ISystemMetaValidationRulesProviderFactory> ();
            _systemMetaRulesProviderStub        = MockRepository.GenerateStub <ISystemMetaValidationRulesProvider>();

            _validator =
                new MetaRulesValidator(
                    new[] { _propertyMetaValidationRuleStub1, _propertyMetaValidationRuleStub2, _propertyMetaValidationRuleStub3 },
                    _systemMetaRulesProviderFactoryStub);
        }
示例#2
0
        public MetaRulesValidatorFactory(ISystemMetaValidationRulesProviderFactory systemMetaValidationRulesProviderFactory)
        {
            ArgumentUtility.CheckNotNull("systemMetaValidationRulesProviderFactory", systemMetaValidationRulesProviderFactory);

            _systemMetaValidationRulesProviderFactory = systemMetaValidationRulesProviderFactory;
        }