public static MethodInfo GetMethodWithLocalFunction(Type type, string methodName, Type[] methodParamTypes, Type[] methodGenericTypes)
        {
#if !PORTABLE
            if (type.IsProxy())
            {
                type = type.BaseType;
            }
            MethodInfo method = type.GetMethod(methodName, MockingUtil.AllMembers, null, methodParamTypes, null);

            if (method == null)
            {
                throw new MissingMemberException(MockingUtil.BuildMissingMethodMessage(type, null, methodName));
            }

            if (method.ContainsGenericParameters && (!GenericTypesMatch(methodGenericTypes, method)))
            {
                throw new MissingMemberException(MockingUtil.BuildGenericMethodNonMatchingTypesMessage(type, method, methodGenericTypes));
            }

            if (method.ContainsGenericParameters)
            {
                method = method.MakeGenericMethod(methodGenericTypes);
            }

            return(method);
#else
            return(null);
#endif
        }
        public static MethodInfo GetMethodWithLocalFunction(Type type, string methodName, Type[] methodParamTypes)
        {
#if !PORTABLE
            if (type.IsProxy())
            {
                type = type.BaseType;
            }
            MethodInfo method = type.GetMethod(methodName, MockingUtil.AllMembers, null, methodParamTypes, null);

            if (method == null)
            {
                throw new MissingMemberException(MockingUtil.BuildMissingMethodMessage(type, null, methodName));
            }
            return(method);
#else
            return(null);
#endif
        }