public void Pattern_matching_is_case_insensitive()
        {
            var input   = "HELLO";
            var pattern = "[a-z]*";

            StringMatching.MatchesPattern(input, pattern).Should().BeTrue();
        }
        public void Exact_text_match_with_no_special_characters_should_return_true()
        {
            var input   = "Hello";
            var pattern = "Hello";

            StringMatching.MatchesPattern(input, pattern).Should().BeTrue();
        }
        public void Patterns_that_do_not_match_input_should_return_false()
        {
            var input   = "Hello";
            var pattern = "^[a]*$";

            StringMatching.MatchesPattern(input, pattern).Should().BeFalse();
        }
        public void Matches_with_valid_regexes_should_return_true()
        {
            var input   = "Hello";
            var pattern = "[A-Za-z]*";

            StringMatching.MatchesPattern(input, pattern).Should().BeTrue();
        }
        public void Non_matching_text_with_no_special_characters_should_return_false()
        {
            var input   = "Hello";
            var pattern = "Goodbye";

            StringMatching.MatchesPattern(input, pattern).Should().BeFalse();
        }
Пример #6
0
        public IActivityAssertions TypeLike(string activityTypePattern)
        {
            if (!StringMatching.MatchesPattern(_activity.Type, activityTypePattern))
            {
                ThrowPatternException(nameof(_activity.Type), activityTypePattern, _activity.Type);
            }

            return(this);
        }
Пример #7
0
        public IActivityAssertions IdLike(string idPattern)
        {
            if (!StringMatching.MatchesPattern(_activity.Id, idPattern))
            {
                ThrowPatternException(nameof(_activity.Id), idPattern, _activity.Id);
            }

            return(this);
        }
Пример #8
0
        public IMessageAssertions SummaryLike(string pattern)
        {
            if (!StringMatching.MatchesPattern(_message.Summary, pattern))
            {
                ThrowPatternException(nameof(_message.Summary), pattern, _message.Summary);
            }

            return(this);
        }
Пример #9
0
        public IMessageAssertions TextLike(string pattern)
        {
            if (!StringMatching.MatchesPattern(_message.Text, pattern))
            {
                ThrowPatternException(nameof(_message.Text), pattern, _message.Text);
            }

            return(this);
        }