示例#1
0
        public void Description_is_concatenated_from_matchers()
        {
            var matcher     = Matches.AnyOf(_failingMatcher, _successfulMatcher);
            var description = new StringDescription();

            matcher.DescribeTo(description);

            Assert.Equal("(Failing matcher or Successful matcher)", description.ToString());
        }
示例#2
0
        public void Match_if_any_matchers_succeed()
        {
            var matcher = Matches.AnyOf(_successfulMatcher, _failingMatcher);

            Assert.Equal(true, matcher.Matches(""));

            matcher = Matches.AnyOf(new List <IMatcher <string> > {
                _failingMatcher, _successfulMatcher
            });
            Assert.Equal(true, matcher.Matches(""));
        }
示例#3
0
        public void Match_if_any_matchers_succeed()
        {
            var matcher = Matches.AnyOf(new[] { successfulMatcher, failingMatcher });

            Assert.AreEqual(true, matcher.Matches(""), "Expected match if any matchers succeed.");

            matcher = Matches.AnyOf(new List <IMatcher <string> > {
                failingMatcher, successfulMatcher
            });
            Assert.AreEqual(true, matcher.Matches(""), "Expected match if any matchers succeed.");
        }
示例#4
0
        public void Shortcut_matching_when_matcher_succeeds()
        {
            var matcher = Matches.AnyOf(_successfulMatcher, _explodingMatcher);

            Assert.Equal(true, matcher.Matches(""));
        }
示例#5
0
        public void No_match_if_all_matchers_fail()
        {
            var matcher = Matches.AnyOf(_failingMatcher, _failingMatcher);

            Assert.Equal(false, matcher.Matches(""));
        }
示例#6
0
        public void Shortcut_matching_when_matcher_succeeds()
        {
            var matcher = Matches.AnyOf(new[] { successfulMatcher, explodingMatcher });

            Assert.AreEqual(true, matcher.Matches(""));
        }
示例#7
0
        public void No_match_if_all_matchers_fail()
        {
            var matcher = Matches.AnyOf(new[] { failingMatcher, failingMatcher });

            Assert.AreEqual(false, matcher.Matches(""), "Expected no match if all matchers fail.");
        }