public void FindByNotCompositeSpecification() { var product = new Product { Price = 99, Name = "Windows XP Professional" }; var spec = new SpecificationQueryStrategy <Product>(p => p.Price < 100).Not(); Assert.False(spec.IsSatisfiedBy(product)); product.Price = 100; Assert.True(spec.IsSatisfiedBy(product)); }
public void FindBySpecification() { var product = new Product { Price = 99 }; var spec = new SpecificationQueryStrategy <Product>(p => p.Price < 100); Assert.True(spec.IsSatisfiedBy(product)); product.Price = 100; Assert.False(spec.IsSatisfiedBy(product)); }