示例#1
0
        public void UrlMatching_should_pass_when_using_standard_regex_features(string url, string regex)
        {
            var cardImages = CardImageTestData.CreateCardImageSetWithOneImageThatHasSetProperties(url: url);

            var sut = new CardImageSetAssertions(cardImages);

            Action act = () => sut.UrlMatching(regex);

            act.ShouldNotThrow<Exception>();
        }
示例#2
0
        public void UrlMatching_should_pass_if_regex_exactly_matches_Url_of_at_least_1_card_regardless_of_case(string url, string regex)
        {
            var cardImages = CardImageTestData.CreateCardImageSetWithOneImageThatHasSetProperties(url: url);

            var sut = new CardImageSetAssertions(cardImages);

            Action act = () => sut.UrlMatching(regex);

            act.ShouldNotThrow<Exception>();
        }
示例#3
0
        public void UrlMatching_should_pass_if_regex_exactly_matches_message_Url_of_one_card(string cardUrlAndRegex)
        {
            var cardImages = CardImageTestData.CreateCardImageSetWithOneImageThatHasSetProperties(url: cardUrlAndRegex);

            var sut = new CardImageSetAssertions(cardImages);

            Action act = () => sut.UrlMatching(cardUrlAndRegex);

            act.ShouldNotThrow<Exception>();
        }
示例#4
0
        public void UrlMatching_should_output_matches_when_groupMatchingRegex_matches_Url_of_any_card()
        {
            IList<string> matches;

            const string someUrl = "some text";
            var cardImages = CardImageTestData.CreateCardImageSetWithOneImageThatHasSetProperties(url: someUrl);

            var sut = new CardImageSetAssertions(cardImages);

            sut.UrlMatching(someUrl, $"({someUrl})", out matches);

            matches.First().Should().Be(someUrl);
        }
示例#5
0
        public void UrlMatching_should_output_multiple_matches_when_groupMatchingRegex_matches_Url_several_times_for_a_single_card()
        {
            IList<string> matches;

            const string someUrl = "some text";
            var cardImages = CardImageTestData.CreateCardImageSetWithOneImageThatHasSetProperties(url: someUrl);

            var sut = new CardImageSetAssertions(cardImages);

            const string match1 = "some";
            const string match2 = "text";
            sut.UrlMatching(someUrl, $"({match1}) ({match2})", out matches);

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