public void AddNullMatchersThrowsException()
        {
            var aggregateMatcher = new AggregateMatcher();

            Should.Throw <ArgumentNullException>(() =>
                                                 aggregateMatcher.Add((IEnumerable <IMatcher>)null));
        }
        public void AddSelfThrowsException()
        {
            var aggregateMatcher = new AggregateMatcher();

            Should.Throw <ArgumentException>(() =>
                                             aggregateMatcher.Add(aggregateMatcher))
            .Message.ShouldContain("circular");
        }
        public void AddGeneralMatcherAddsTheMatcher()
        {
            var aggregateMatcher = new AggregateMatcher();

            aggregateMatcher.Add(new ContainsMatcher("abc"));

            dynamic jailBrokenMatcher = new Jailbreak <AggregateMatcher>(aggregateMatcher);
            var     count             = (int)jailBrokenMatcher._matchers.Count;

            count.ShouldBe(1);
        }
        public void AddNullMatcherSkipsAdd()
        {
            var aggregateMatcher = new AggregateMatcher();

            aggregateMatcher.Add(NullMatcher.Instance);

            dynamic jailBrokenMatcher = new Jailbreak <AggregateMatcher>(aggregateMatcher);
            var     count             = (int)jailBrokenMatcher._matchers.Count;

            count.ShouldBe(0);
        }
        public void AddMultipleMatcherAddsAllTheMatchers()
        {
            var aggregateMatcher = new AggregateMatcher();

            aggregateMatcher.Add(new IMatcher[]
            {
                new ContainsMatcher("abc"),
                new RegexMatcher("def"),
            });

            dynamic jailBrokenMatcher = new Jailbreak <AggregateMatcher>(aggregateMatcher);
            var     count             = (int)jailBrokenMatcher._matchers.Count;

            count.ShouldBe(2);
        }