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