private static string GetTypeNameFromType(ISymbol symbol) { return symbol.GetSimpleTypeName(); }
private static bool IsCorrespondingType(ISymbol symbol, ISymbol x, IReadOnlyDictionary<string, ITypeSymbol> sutSubstitutions) { var methodSymbol = x as IMethodSymbol; var propertySymbol = x as IPropertySymbol; var typeSymbol = x as INamedTypeSymbol; if (methodSymbol == null && propertySymbol == null && typeSymbol == null) return false; var ct = methodSymbol != null ? methodSymbol.ReceiverType : propertySymbol?.ContainingType ?? typeSymbol; var symbolDefinitionsReplacement = TestSemanticHelper.GetReplacedDefinitions(sutSubstitutions, ct); var ctName = ct.GetSimpleTypeName(); return symbol.GetSimpleTypeName() == ctName || symbolDefinitionsReplacement.Select(z => z.Result).Contains(symbol.GetSimpleTypeName()) || (symbol as INamedTypeSymbol)?.AllInterfaces.Any(z => IsCorrespondingType(z, x, sutSubstitutions)) == true; }