public void ValidSpecification_WithInvalidWhereClause_IsFalse() { var expression = new IsShortStringSpecification().Where(t => t.EndsWith("xxx")); var result = expression.Compile().Invoke(ShortString); Assert.IsFalse(result); }
public void InvalidSpecification_WhenNegated_IsTrue() { var specification = new IsShortStringSpecification(); var result = specification.Not().IsSatisfiedBy(LongString); Assert.IsTrue(result); }
public void ValidSpecification_WithValidOrLambda_IsTrue() { var specification = new IsShortStringSpecification().Or(new StartsWithSpecification("s")); var result = specification.IsSatisfiedBy(ShortString); Assert.IsTrue(result); }
public void InvalidSpecification_IsFalse() { var specification = new IsShortStringSpecification(); var result = specification.IsSatisfiedBy(LongString); Assert.IsFalse(result); }
public void ValidSpecification_WithInvalidAndLambda_IsFalse() { var specification = new IsShortStringSpecification().And(new EndsWithSpecification("xxx")); var result = specification.IsSatisfiedBy(ShortString); Assert.IsFalse(result); }
public void ValidSpecification_IsTrue() { var specification = new IsShortStringSpecification(); var result = specification.IsSatisfiedBy(ShortString); Assert.IsTrue(result); }
public void InvalidSpecification_WithValidAndLambda_IsFalse() { var specification = new IsShortStringSpecification().And(new StartsWithSpecification("s")); var result = specification.IsSatisfiedBy(LongString); Assert.IsFalse(result); }
public void ValidSpecification_WithValidWhereClause_IsTrue() { var expression = new IsShortStringSpecification().Where(t => t.StartsWith("s")); var result = expression.Compile().Invoke(ShortString); Assert.IsTrue(result); }
public void LeftIsFalse_And_RightIsTrue_IsFalse() { var left = new IsShortStringSpecification(); var right = new ContainsLongSpecification(); var specification = left.And(right); var result = specification.IsSatisfiedBy(LongString); Assert.IsFalse(result); }