public void MatchesIfArgumentInCollection() { ICollection collection = CollectionOf(1, 2, 3, 4); Matcher matcher = new ElementMatcher(collection); Assert.IsTrue(matcher.Matches(1), "should match 1"); Assert.IsTrue(matcher.Matches(2), "should match 2"); Assert.IsTrue(matcher.Matches(3), "should match 3"); Assert.IsTrue(matcher.Matches(4), "should match 4"); Assert.IsFalse(matcher.Matches(0), "should not match 0"); }
public void IsNullSafe() { ICollection collection = CollectionOf(1, 2, null, 4); Matcher matcher = new ElementMatcher(collection); Assert.IsTrue(matcher.Matches(1), "should match 1"); Assert.IsTrue(matcher.Matches(2), "should match 2"); Assert.IsTrue(matcher.Matches(null), "should match null"); Assert.IsTrue(matcher.Matches(4), "should match 4"); Assert.IsFalse(matcher.Matches(0), "should not match 0"); }