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