public static void MapTypeName(this ISymbolMap symbols, string fullyQualifiedName, string frameworkName, TypeKind kind) { var proxyName = $"{frameworkName}Proxy"; switch (kind) { case TypeKind.Interface: var defaultName = frameworkName; symbols .GetInterfaceProxyName(Arg.Is <InterfaceType>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(proxyName); symbols .GetInterfaceDefaultName(Arg.Is <InterfaceType>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(defaultName); symbols .GetInterfaceProxyNameSyntaxToken(Arg.Is <InterfaceType>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseToken(proxyName)); symbols .GetInterfaceDefaultNameSyntaxToken(Arg.Is <InterfaceType>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseToken(defaultName)); symbols .GetInterfaceProxyNameSyntax(Arg.Is <InterfaceType>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseName(proxyName)); symbols .GetInterfaceDefaultNameSyntax(Arg.Is <InterfaceType>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseName(defaultName)); frameworkName = $"I{frameworkName}"; break; case TypeKind.Class: symbols .GetAbstractClassProxyName(Arg.Is <ClassType>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(proxyName); break; } symbols .GetName(Arg.Is <Type>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(frameworkName); symbols .GetName(Arg.Is <string>(fqn => fqn == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(frameworkName); symbols .GetNameSyntaxToken(Arg.Is <Type>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseToken(frameworkName)); symbols .GetNameSyntaxToken(Arg.Is <string>(fqn => fqn == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseToken(frameworkName)); symbols .GetNameSyntax(Arg.Is <Type>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseName(frameworkName)); symbols .GetNameSyntax(Arg.Is <string>(fqn => fqn == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseName(frameworkName)); symbols .GetTypeSyntax(Arg.Is <TypeReference>(t => t.FullyQualifiedName == fullyQualifiedName), false) .Returns(SF.ParseTypeName(frameworkName)); }
public static void MapTypeName(this ISymbolMap symbols, string fullyQualifiedName, string frameworkName, TypeKind kind) { if (kind == TypeKind.Interface) { string proxyName = $"{frameworkName}Proxy"; string defaultName = frameworkName; symbols .GetInterfaceProxyName(Arg.Is <InterfaceType>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(proxyName); symbols .GetInterfaceDefaultName(Arg.Is <InterfaceType>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(defaultName); symbols .GetInterfaceProxyNameSyntaxToken(Arg.Is <InterfaceType>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseToken(proxyName)); symbols .GetInterfaceDefaultNameSyntaxToken(Arg.Is <InterfaceType>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseToken(defaultName)); symbols .GetInterfaceProxyNameSyntax(Arg.Is <InterfaceType>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseName(proxyName)); symbols .GetInterfaceDefaultNameSyntax(Arg.Is <InterfaceType>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseName(defaultName)); frameworkName = $"I{frameworkName}"; } symbols .GetName(Arg.Is <Type>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(frameworkName); symbols .GetName(Arg.Is <string>(fqn => fqn == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(frameworkName); symbols .GetNameSyntaxToken(Arg.Is <Type>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseToken(frameworkName)); symbols .GetNameSyntaxToken(Arg.Is <string>(fqn => fqn == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseToken(frameworkName)); symbols .GetNameSyntax(Arg.Is <Type>(t => t.FullyQualifiedName == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseName(frameworkName)); symbols .GetNameSyntax(Arg.Is <string>(fqn => fqn == fullyQualifiedName), disambiguate: Arg.Any <bool>()) .Returns(SF.ParseName(frameworkName)); symbols .GetTypeSyntax(Arg.Is <TypeReference>(t => t.FullyQualifiedName == fullyQualifiedName)) .Returns(SF.ParseTypeName(frameworkName)); }
public static void MapPropertyName(this ISymbolMap symbols, string ownerFullyQualifiedName, string jsiiName, string frameworkName) { symbols.GetName( Arg.Is <Type>(t => t.FullyQualifiedName == ownerFullyQualifiedName), Arg.Is <Property>(p => p.Name == jsiiName) ).Returns(frameworkName); symbols.GetNameSyntaxToken( Arg.Is <Type>(t => t.FullyQualifiedName == ownerFullyQualifiedName), Arg.Is <Property>(p => p.Name == jsiiName) ).Returns(SF.ParseToken(frameworkName)); symbols.GetNameSyntax( Arg.Is <Type>(t => t.FullyQualifiedName == ownerFullyQualifiedName), Arg.Is <Property>(p => p.Name == jsiiName) ).Returns(SF.ParseName(frameworkName)); }
public static void MapAssemblyName(this ISymbolMap symbols, string jsiiName, string frameworkName) { symbols .GetName(Arg.Is <Assembly>(a => a.Name == jsiiName)) .Returns(frameworkName); symbols .GetNameSyntaxToken(Arg.Is <Assembly>(a => a.Name == jsiiName)) .Returns(SF.ParseToken(frameworkName)); symbols .GetNameSyntax(Arg.Is <Assembly>(a => a.Name == jsiiName)) .Returns(SF.ParseName(frameworkName)); symbols .GetAssemblyName(Arg.Is <string>(n => n == jsiiName)) .Returns(frameworkName); }
public static void MapParameterName(this ISymbolMap symbols, string jsiiName, string frameworkName) { symbols.GetName(Arg.Is <Parameter>(t => t.Name == jsiiName)).Returns(frameworkName); symbols.GetNameSyntaxToken(Arg.Is <Parameter>(t => t.Name == jsiiName)).Returns(SF.ParseToken(frameworkName)); symbols.GetNameSyntax(Arg.Is <Parameter>(t => t.Name == jsiiName)).Returns(SF.ParseName(frameworkName)); }