Exemple #1
0
        /// <summary>
        /// Retrieve products meets given condition. Condition is passed in the form of query
        /// </summary>
        /// <returns></returns>
        public IEnumerable <Product> Get(string usage, string startBy)
        {
            if (string.IsNullOrEmpty(usage) || string.IsNullOrEmpty(startBy))
            {
                throw new ArgumentException("Invalid Argument, Argument can not be Null or Empty.");
            }

            IProductCommand <Product, bool> command =
                new ProductByUsageAndStartDate(
                    usage, DateTimeUtil.ConvertFromString(startBy));

            return(this.repositiry.Find(command));
        }
        public void NewInstance_validInputs_ObjectCreated()
        {
            var testObject = new ProductByUsageAndStartDate("digital download", new DateTime(2012, 3, 1));

            Assert.IsNotNull(testObject);
        }