public void Not_LengthBetween5And10() { ISpecification <string> lengthBetween5And10 = new PredicateSpecification <string>(s => s.Length >= 5 && s.Length <= 10); ISpecification <string> subject = lengthBetween5And10.Not(); Assert.That(subject, Must.Not.Be.SatisfiedBy("123456")); Assert.That(subject, Must.Be.SatisfiedBy("1234").And("1234567890123")); }
public void Specification_Should_Be_Saved() { ISpecification <int> spec = new PredicateSpecification <int>(x => x == 5); var notSpec = spec.Not(); Assert.IsInstanceOf <NotSpecification <int> >(notSpec); Assert.AreEqual(((NotSpecification <int>)notSpec).Specification, spec); }
public void Specification_Should_Be_Saved() { ISpecification<int> spec = new PredicateSpecification<int>(x => x == 5); var notSpec = spec.Not(); Assert.IsInstanceOf<NotSpecification<int>>(notSpec); Assert.AreEqual(((NotSpecification<int>)notSpec).Specification, spec); }