public void Matches_should_detect_item_via_collection_Contains_unless_a_comparer_is_specified() { var subj = new ContainsMatcher <string>("c", StringComparer.OrdinalIgnoreCase); var collection = new PCollectionWithContains(); Assert.True(subj.Matches(collection), "should ignore case"); Assert.Equal(0, collection.ContainsCallCount, "should not be invoked"); }
public void Matches_should_detect_item_via_collection_Contains() { var subj = new ContainsMatcher <string>("C"); var collection = new PCollectionWithContains(); Assert.True(subj.Matches(collection)); Assert.Equal(1, collection.ContainsCallCount); }
public void Matches_should_detect_item_failure() { var subj = new ContainsMatcher <string>("z"); Assert.False(subj.Matches(new [] { "a", "b", "c" })); }
public void Matches_should_detect_item_nominal() { var subj = new ContainsMatcher <string>("C", StringComparer.OrdinalIgnoreCase); Assert.True(subj.Matches(new [] { "a", "b", "c" })); }