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

            Assert.False(subj.Matches(new [] { "a", "b", "c" }));
        }
Exemplo 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" }));
        }