public static string GetFullyQualifiedTypeName(ITypeInfoProvider @type) { string typeName = GetTypeName(@type); if (MethodNameNormalizer.IsLambdaMethod(typeName)) { return(null); } string ns = @type.Namespace; if (!string.IsNullOrEmpty(ns)) { typeName = ns + "." + typeName; } return(typeName); }
private static string GetMethodNamePart(IMethodInfoProvider method) { var sb = new StringBuilder(); sb.Append(TypeFromMethodDelimiter); sb.Append(MethodNameNormalizer.Normalize(method.Name)); if (method.IsGenericMethodDefinition) { sb.Append("<"); sb.Append(string.Join(", ", method.GetGenericArguments().Select(a => a.ToString()))); sb.Append(">"); } string methodNamePart = sb.ToString(); // exclude compiler-generated lambda methods like "SomeTestType::<MethodWithLambdasInside>b__0(object actParam)" if (MethodNameNormalizer.IsLambdaMethod(methodNamePart)) { return(null); } return(methodNamePart); }