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"]; }
public void SetupContext() { Matcher = MethodMatcherTestHelper.GetMethodNameMatcher <MultiWordTestContext>("Foo"); FoundMatches = Matcher.GetMatches("Foo Bar Baz"); Partial = FoundMatches.OfType <PartialMatch>().FirstOrDefault(); Exact = FoundMatches.OfType <ExactMatch>().FirstOrDefault(); }
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"); }
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); }
public void SetupContext() { Matcher = MethodMatcherTestHelper.GetMethodNameMatcher <EnumTestContext>("Test_parsing_of_enumValue"); }
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(); }
private IEnumerable <NameMatch> GetMatches(string text, string methodName) { var matcher = MethodMatcherTestHelper.GetMethodNameMatcher <Embedded_number_test_context>(methodName); return(matcher.GetMatches(text)); }
public void SetupContext() { var matcher = MethodMatcherTestHelper.GetMethodNameMatcher <Punctuation_test_context>("its_good_to_handle_apostrophes"); Matches = matcher.GetMatches("It's good to handle apostrophes"); }
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(); }