public void AndNot_SameLinqPredicate_SameResults() { var spec1 = new StringContainsSpecification("ab"); var spec2 = new StringLengthSpecification(3); var spec = spec1.AndNot(spec2); var actual = StringCollection.Items.Where(x => spec.IsSatisfiedBy(x)); var expected = StringCollection.Items.Where(x => x.Contains(spec1.Part) && x.Length != spec2.Length); Assert.Equal(expected, actual); }
public void IsSatisfiedBy_StringCandidateAndLengthCriteria_ExpectedValue(string input, int length, bool expected) { var spec = new StringLengthSpecification(length); Assert.Equal(expected, spec.IsSatisfiedBy(input)); }