private MemberDeclarationSyntax MockVirtualMethod()
        {
            var parameters = F.SeparatedList(Symbol.Parameters.Select(ps => TypesForSymbols.AsParameterSyntax(ps)));

            if (ArglistParameterName != null && TypesForSymbols.RuntimeArgumentHandle() != null)
            {
                parameters = parameters.Add(F.Parameter(F.Identifier(ArglistParameterName)).WithType(TypesForSymbols.RuntimeArgumentHandle()));
            }

            var method = F.MethodDeclaration(ReturnTypeWithoutReadonly, F.Identifier(MemberMockName))
                         .WithModifiers(F.TokenList(F.Token(SyntaxKind.ProtectedKeyword), F.Token(SyntaxKind.VirtualKeyword)))
                         .WithParameterList(F.ParameterList(parameters))
                         .WithBody(F.Block(ThrowMockMissingStatement("VirtualMethod")));

            if (Symbol.TypeParameters.Any())
            {
                method = method.WithTypeParameterList(TypeParameterList());

                var constraints = TypesForSymbols.AsConstraintClauses(Symbol.TypeParameters);

                if (constraints.Any())
                {
                    method = method.AddConstraintClauses(constraints);
                }
            }

            return(method);
        }
        private MemberDeclarationSyntax ExplicitInterfaceMember()
        {
            var parameters = F.SeparatedList(Symbol.Parameters.Select(p => TypesForSymbols.AsParameterSyntax(p)));

            if (ArglistParameterName != null)
            {
                parameters = parameters.Add(F.Parameter(F.Token(SyntaxKind.ArgListKeyword)));
            }

            var arguments = Symbol.Parameters.AsArgumentList();

            if (ArglistParameterName != null && TypesForSymbols.RuntimeArgumentHandle() != null)
            {
                arguments = arguments.Add(F.Argument(F.LiteralExpression(SyntaxKind.ArgListExpression, F.Token(SyntaxKind.ArgListKeyword))));
            }

            var mockedMethod = F.MethodDeclaration(ReturnType, Symbol.Name)
                               .WithParameterList(F.ParameterList(parameters))
                               .WithExplicitInterfaceSpecifier(F.ExplicitInterfaceSpecifier(TypesForSymbols.ParseName(InterfaceSymbol)));

            if (Symbol.TypeParameters.Any())
            {
                mockedMethod = mockedMethod.WithTypeParameterList(TypeParameterList());
            }

            var invocation = Symbol.TypeParameters.Any()
                ? (ExpressionSyntax)F.GenericName(MemberMockName)
                             .WithTypeArgumentList(F.TypeArgumentList(
                                                       F.SeparatedList(Symbol.TypeParameters.Select(typeParameter =>
                                                                                                    TypesForSymbols.ParseTypeName(typeParameter, false)))))
                : F.IdentifierName(MemberMockName);

            invocation = F.InvocationExpression(invocation, F.ArgumentList(arguments));

            if (Symbol.ReturnsByRef || Symbol.ReturnsByRefReadonly)
            {
                invocation = F.RefExpression(invocation);
            }

            mockedMethod = mockedMethod
                           .WithExpressionBody(F.ArrowExpressionClause(invocation))
                           .WithSemicolonToken(F.Token(SyntaxKind.SemicolonToken));

            return(mockedMethod);
        }