public void Setup()
        {
            this.productCategorizer = new Mock <IProductCategorizer>(MockBehavior.Strict);
            this.productHelper      = new Mock <IProductHelper>(MockBehavior.Strict);
            this.ruleValidator      = new Mock <IRuleValidationEngine>(MockBehavior.Strict);

            this.validator = new CompoundValidator(this.productCategorizer.Object, this.productHelper.Object, this.ruleValidator.Object);
        }
Example #2
0
        public QueryInterpreter(
            IProductCategorizer productCategorizer,
            IProductHelper productHelper,
            ICompoundValidator validator,
            IDictionary <string, string> intergalacticProductsCache,
            IDictionary <string, decimal> earthyProductsCache)
        {
            if (intergalacticProductsCache == null)
            {
                throw new ArgumentNullException("intergalacticProductsCache");
            }

            if (earthyProductsCache == null)
            {
                throw new ArgumentNullException("earthyProductsCache");
            }

            this.productCategorizer         = productCategorizer;
            this.productHelper              = productHelper;
            this.validator                  = validator;
            this.intergalacticProductsCache = intergalacticProductsCache;
            this.earthyProductsCache        = earthyProductsCache;
        }