示例#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();
        }