Esempio n. 1
0
        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");
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        public void Matches_should_detect_item_failure()
        {
            var subj = new ContainsMatcher <string>("z");

            Assert.False(subj.Matches(new [] { "a", "b", "c" }));
        }
Esempio n. 4
0
        public void Matches_should_detect_item_nominal()
        {
            var subj = new ContainsMatcher <string>("C", StringComparer.OrdinalIgnoreCase);

            Assert.True(subj.Matches(new [] { "a", "b", "c" }));
        }