public void MoreThan10_OrOp_LessThan5() { PredicateSpecification <int> moreThan10 = PredicateSpecification.For <int>(i => i > 10); var lessThan5 = new PredicateSpecification <int>(i => i < 5); PredicateSpecification <int> subject = lessThan5 || moreThan10; Assert.That(subject, Must.Not.Be.SatisfiedBy(7)); Assert.That(subject, Must.Be.SatisfiedBy(3).And(13)); }
public void MoreThan5_AndOp_LessThan10() { PredicateSpecification <int> lessThan10 = PredicateSpecification.For <int>(i => i < 10); var moreThan5 = new PredicateSpecification <int>(i => i > 5); PredicateSpecification <int> subject = lessThan10 && moreThan5; Assert.That(subject, Must.Be.SatisfiedBy(7)); Assert.That(subject, Must.Not.Be.SatisfiedBy(3).Or(13)); }