public void ProductPriceGreaterThanSpecification_ShouldNotBeSatisfied_WhenProductIsNotOnSale() { var product = new Product(50, false); var result = new ProductPriceGreaterThanSpecification(50).IsSatisfiedBy(product); Assert.That(result, Is.False); }
public List<Product> GetSaleProductsOverPrice(double highItemPrice) { Specification<Product> saleSpec = new ProductOnSaleSpecification(); Specification<Product> priceSpec = new ProductPriceGreaterThanSpecification(highItemPrice); return Items.FindAll(saleSpec.And(priceSpec).IsSatisfiedBy); }