예제 #1
0
 public CompoundValidator(
     IProductCategorizer productCategorizer,
     IProductHelper productHelper,
     IRuleValidationEngine validator)
 {
     this.productCategorizer = productCategorizer;
     this.productHelper      = productHelper;
     this.validator          = validator;
 }
        public void Setup()
        {
            this.arabicNumeralValidator   = new Mock <IValidator <int> >(MockBehavior.Strict);
            this.romanNumeralValidator    = new Mock <IValidator <string> >(MockBehavior.Strict);
            this.validationMessageManager = new Mock <IValidationMessageManager>(MockBehavior.Strict);

            this.validator = new RuleValidationEngine(this.arabicNumeralValidator.Object,
                                                      this.romanNumeralValidator.Object, this.validationMessageManager.Object);
        }
예제 #3
0
        public ProductDataValidator(
            IRuleValidationEngine validator,
            IProductCategorizer productCategorizer,
            ICollection <string> productsList)
        {
            if (productsList == null)
            {
                throw new ArgumentNullException("productsList");
            }

            this.validator          = validator;
            this.productCategorizer = productCategorizer;
            this.productsList       = productsList;
        }