Пример #1
0
        public void SetupContext()
        {
            var matcher = MethodMatcherTestHelper.GetMethodNameMatcher <Typed_table_test_context>("method_takes_a_typed_array");

            Match      = matcher.GetMatches("Method takes a typed array\r\n|IntParam|StringParam|\r\n|1|2|\r\n|3|4|\r\n|5|6|").FirstOrDefault();
            ParamValue = Match.ParamValues["values"];
        }
Пример #2
0
 public void SetupContext()
 {
     Matcher      = MethodMatcherTestHelper.GetMethodNameMatcher <MultiWordTestContext>("Foo");
     FoundMatches = Matcher.GetMatches("Foo Bar Baz");
     Partial      = FoundMatches.OfType <PartialMatch>().FirstOrDefault();
     Exact        = FoundMatches.OfType <ExactMatch>().FirstOrDefault();
 }
Пример #3
0
        public void should_match_field()
        {
            var matcher = MethodMatcherTestHelper.GetPropertyMatcher <PropertyAndFieldTestContext>("BarField");
            var matches = matcher.GetMatches("bar field");

            matches.Count().ShouldBe(1);
            matches.First().MatchedText.ShouldBe("bar field");
        }
Пример #4
0
        public void should_match_a_negative_decimal()
        {
            Matcher = MethodMatcherTestHelper.GetMethodNameMatcher <Numeric_matching_test_context>("method_takes_a_decimal");
            var matches = Matcher.GetMatches("method takes a decimal -42");

            matches.Count().ShouldBe(1);
            matches.First().ParamValues.First().Value.ShouldEqual(-42m);
        }
Пример #5
0
 public void SetupContext()
 {
     Matcher = MethodMatcherTestHelper.GetMethodNameMatcher <EnumTestContext>("Test_parsing_of_enumValue");
 }
Пример #6
0
        public void SetupContext()
        {
            var matcher = MethodMatcherTestHelper.GetMethodNameMatcher <Partial_match_test_context>("when_a_user_named");

            Match = matcher.GetMatches("when a user named foo does something").FirstOrDefault();
        }
Пример #7
0
        private IEnumerable <NameMatch> GetMatches(string text, string methodName)
        {
            var matcher = MethodMatcherTestHelper.GetMethodNameMatcher <Embedded_number_test_context>(methodName);

            return(matcher.GetMatches(text));
        }
Пример #8
0
        public void SetupContext()
        {
            var matcher = MethodMatcherTestHelper.GetMethodNameMatcher <Punctuation_test_context>("its_good_to_handle_apostrophes");

            Matches = matcher.GetMatches("It's good to handle apostrophes");
        }
Пример #9
0
        public void SetupContext()
        {
            var matcher = MethodMatcherTestHelper.GetMethodNameMatcher <Table_matching_test_context>("method_takes_a_table");

            Match = matcher.GetMatches("Method takes a table\r\n|1|2|\r\n|3|4|\r\n|5|6|").FirstOrDefault();
        }