Пример #1
0
        private NamespaceDeclarationSyntax GetNamespaceDecl(CInfo cInfo)
        {
            NamespaceDeclarationSyntax namespaceDecl = NamespaceDeclaration(QualifiedName(
                                                                                IdentifierName(cInfo.Namespace), IdentifierName("Tests")));

            return(namespaceDecl);
        }
Пример #2
0
        private SyntaxList <MemberDeclarationSyntax> GetMembers(CInfo cInfo)
        {
            var methods = new List <MemberDeclarationSyntax>();

            foreach (string mName in cInfo.Methods)
            {
                methods.Add(GetMethodDec(mName));
            }

            return(new SyntaxList <MemberDeclarationSyntax>(methods));
        }
Пример #3
0
        private SyntaxList <UsingDirectiveSyntax> GetUsings(CInfo cInfo)
        {
            var usings = new List <UsingDirectiveSyntax>()
            {
                UsingDirective(IdentifierName("System")),
                UsingDirective(IdentifierName("System.Collections.Generic")),
                UsingDirective(IdentifierName("System.Linq")),
                UsingDirective(IdentifierName("System.Text")),
                UsingDirective(IdentifierName("Microsoft.VisualStudio.TestTools.UnitTesting")),
                UsingDirective(IdentifierName(cInfo.Namespace))
            };

            return(new SyntaxList <UsingDirectiveSyntax>(usings));
        }