Exemplo n.º 1
0
        private string DescribeParameter(RegexMatcher matcher, int currentParam)
        {
            string s;
            var param = ((MethodInfo) matcher.MemberInfo).GetParameters().ElementAt(currentParam);

            s = _parameterDescriber.DescribeParameter(param.ParameterType, param.Name);
            return s;
        }
Exemplo n.º 2
0
 public void SetupContext()
 {
     var matcher = new RegexMatcher("^Some fake method name (.+)",
                                    typeof (RegexTestContext).GetMethod("MethodWithParams"));
     TestText = "Some fake method name and some other text";
     TestMatch = matcher.GetMatch(TestText);
 }
Exemplo n.º 3
0
 public void No_partial_matching_on_void_methods()
 {
     var Matcher = new RegexMatcher("^Some fake method name", typeof (RegexTestContext).GetMethod("VoidMethod"));
     Matcher.GetMatch("Some fake method name blah blah blah").ShouldBeNull();
 }
Exemplo n.º 4
0
 public void can_partially_match_on_properties()
 {
     var Matcher = new RegexMatcher("^Foo Bar", typeof (RegexTestContext).GetProperty("SomeProperty"));
     Matcher.GetMatch("Foo Bar Baz").ShouldBeOfType<PartialMatch>();
 }
Exemplo n.º 5
0
 public void SetupContext()
 {
     var matcher = new RegexMatcher("^Some fake method name", typeof(RegexTestContext).GetMethod("MethodWithReturnValue"));
     TestText = "Some fake method name";
     TestMatch = matcher.GetMatch(TestText);
 }
Exemplo n.º 6
0
 public void can_partially_match_on_fields()
 {
     var Matcher = new RegexMatcher("^Foo Bar", typeof (RegexTestContext).GetField("SomeField"));
     Matcher.GetMatch("Foo Bar Baz").ShouldBeOfType<PartialMatch>();
 }
Exemplo n.º 7
0
 public void SetupContext()
 {
     var matcher = new RegexMatcher("^Some fake method name", null);
     TestMatch = matcher.GetMatch("this does not match");
 }