private Invocation BuildInvocation(MemberInfo memberInfo, NameMatch currentMatch)
        {
            if (memberInfo is MethodInfo)
                return new Invocation(memberInfo,
                    BuildParamValues((MethodInfo) memberInfo, currentMatch.ParamValues),
                    BuildRawParamValues((MethodInfo) memberInfo, currentMatch.ParamValues),
                                      currentMatch.MatchedText);

            return new Invocation(memberInfo, new string[0], new string[0], currentMatch.MatchedText);
        }
 public void SetupContext()
 {
     var matcher = new RegexMatcher("^Some fake method name", typeof(RegexTestContext).GetMethod("MethodWithReturnValue"));
     TestText = "Some fake method name";
     TestMatch = matcher.GetMatch(TestText);
 }
 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);
 }
 public void SetupContext()
 {
     var matcher = new RegexMatcher("^Some fake method name", null);
     TestMatch = matcher.GetMatch("this does not match");
 }