public void FindProductsByColorAndSizeTest()
        {
            ColorSpecification colorSpecification = new ColorSpecification(ProductColor.GREEN);

            SizeSpecification sizeSpecification = new SizeSpecification(ProductSize.SMALL);

            Specification colorAndSizeSpecification =
                new AndSpecification(colorSpecification, sizeSpecification);

            IList<Product> filteredProducts =
                _productRepositoryWithSpecification.FindProducts(colorAndSizeSpecification);

            Assert.AreEqual(0, filteredProducts.Count);
        }
        public void FindProductsByColorAndBelowPriceTest()
        {
            ColorSpecification colorSpecification = new ColorSpecification(ProductColor.GREEN);

            BelowPriceSpecification belowPriceSpecification = new BelowPriceSpecification(10);

            Specification colorAndBelowPriceSpecification =
                new AndSpecification(colorSpecification, belowPriceSpecification);

            IList<Product> filteredProducts =
                _productRepositoryWithSpecification.FindProducts(colorAndBelowPriceSpecification);

            Assert.AreEqual(1, filteredProducts.Count);
            Assert.AreEqual("Frisbee", filteredProducts.First().Description);
        }
        public void FindProductsByColorOrSizeTest()
        {
            ColorSpecification colorSpecification = new ColorSpecification(ProductColor.GREEN);

            SizeSpecification sizeSpecification = new SizeSpecification(ProductSize.SMALL);

            Specification colorOrSizeSpecification =
                new OrSpecification(colorSpecification, sizeSpecification);

            IList<Product> filteredProducts =
                _productRepositoryWithSpecification.FindProducts(colorOrSizeSpecification);

            Assert.AreEqual(2, filteredProducts.Count);
            Assert.AreEqual("Barbie Classic", filteredProducts.First().Description);
            Assert.AreEqual("Frisbee", filteredProducts.Last().Description);
        }