Exemple #1
0
        public void ValueMatching_should_output_multiple_matches_when_groupMatchingRegex_matches_Value_on_multiple_cards()
        {
            IList <string> matches;

            var facts = FactTestData.CreateRandomFacts();

            facts.Add(new Fact(value: "some text"));
            facts.Add(new Fact(value: "same text"));

            var sut = new FactSetAssertions(facts);

            sut.ValueMatching(".*", @"(s[oa]me) (text)", out matches);

            matches.Should().Contain("some", "same", "text");
        }
Exemple #2
0
        public void ValueMatching_should_output_multiple_matches_when_groupMatchingRegex_matches_Value_several_times_for_a_single_card()
        {
            IList <string> matches;

            const string someValue = "some text";
            var          facts     = FactTestData.CreateFactSetWithOneFactThatHasSetProperties(value: someValue);

            var sut = new FactSetAssertions(facts);

            const string match1 = "some";
            const string match2 = "text";

            sut.ValueMatching(someValue, $"({match1}) ({match2})", out matches);

            matches.Should().Contain(match1, match2);
        }