30 references to CompilationUnit
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (18)
CodeGeneration\SyntaxGeneratorTests.cs (18)
1775Generator.CompilationUnit(), 1779Generator.CompilationUnit( 1784Generator.CompilationUnit( 1789Generator.CompilationUnit( 1795Generator.CompilationUnit( 1924Generator.CompilationUnit(Generator.NamespaceDeclaration("n")), 1931Generator.CompilationUnit(Generator.NamespaceDeclaration("n")), 2625AssertNamesEqual("x.y", Generator.GetNamespaceImports(Generator.AddNamespaceImports(Generator.CompilationUnit(), Generator.NamespaceImportDeclaration("x.y")))); 2626AssertNamesEqual(new[] { "x.y", "z" }, Generator.GetNamespaceImports(Generator.AddNamespaceImports(Generator.CompilationUnit(), Generator.NamespaceImportDeclaration("x.y"), Generator.IdentifierName("z")))); 2627AssertNamesEqual("", Generator.GetNamespaceImports(Generator.AddNamespaceImports(Generator.CompilationUnit(), Generator.MethodDeclaration("m")))); 2628AssertNamesEqual(new[] { "x", "y.z" }, Generator.GetNamespaceImports(Generator.AddNamespaceImports(Generator.CompilationUnit(Generator.IdentifierName("x")), Generator.DottedName("y.z")))); 2634TestRemoveAllNamespaceImports(Generator.CompilationUnit(Generator.NamespaceImportDeclaration("x"))); 2635TestRemoveAllNamespaceImports(Generator.CompilationUnit(Generator.NamespaceImportDeclaration("x"), Generator.IdentifierName("y"))); 2637TestRemoveNamespaceImport(Generator.CompilationUnit(Generator.NamespaceImportDeclaration("x")), "x", []); 2638TestRemoveNamespaceImport(Generator.CompilationUnit(Generator.NamespaceImportDeclaration("x"), Generator.IdentifierName("y")), "x", ["y"]); 2639TestRemoveNamespaceImport(Generator.CompilationUnit(Generator.NamespaceImportDeclaration("x"), Generator.IdentifierName("y")), "y", ["x"]); 2755AssertMemberNamesEqual("n", Generator.AddMembers(Generator.CompilationUnit(), [Generator.NamespaceDeclaration("n")])); 2873Assert.Equal(DeclarationKind.CompilationUnit, Generator.GetDeclarationKind(Generator.CompilationUnit()));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeGeneration\AbstractCodeGenerationTests.cs (1)
52return codeDefFactory.CompilationUnit(
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (9)
CodeGeneration\SyntaxGeneratorTests.vb (9)
1707Generator.CompilationUnit(), 1711Generator.CompilationUnit( 1718Generator.CompilationUnit( 1724Generator.CompilationUnit( 1734Generator.CompilationUnit( 2232Generator.CompilationUnit(Generator.NamespaceDeclaration("n")), 2242Generator.CompilationUnit(Generator.NamespaceDeclaration("n")), 2565Assert.Equal(DeclarationKind.CompilationUnit, Generator.GetDeclarationKind(Generator.CompilationUnit())) 3173AssertMemberNamesEqual("n", Generator.AddMembers(Generator.CompilationUnit(), {Generator.NamespaceDeclaration("n")}))
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
VisualStudioMSBuildWorkspaceTests.cs (2)
2884var doc2 = document.WithSyntaxRoot(gen.CompilationUnit()); // empty CU 2897var doc3 = document.WithSyntaxRoot(gen.CompilationUnit()); // empty CU