49 references to StructDeclaration
Microsoft.CodeAnalysis.CSharp.Features (2)
Snippets\CSharpStructSnippetProvider.cs (2)
39
? generator.
StructDeclaration
(name, accessibility: Accessibility.Public)
40
: generator.
StructDeclaration
(name);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (25)
CodeGeneration\SyntaxGeneratorTests.cs (25)
1574
Generator.
StructDeclaration
("s"),
1578
Generator.
StructDeclaration
("s", typeParameters: new[] { "x", "y" }),
1582
Generator.
StructDeclaration
("s", interfaceTypes: new[] { Generator.IdentifierName("x") }),
1586
Generator.
StructDeclaration
("s", interfaceTypes: new[] { Generator.IdentifierName("x"), Generator.IdentifierName("y") }),
1590
Generator.
StructDeclaration
("s", interfaceTypes: new SyntaxNode[] { }),
1594
Generator.
StructDeclaration
("s", members: new[] { Generator.FieldDeclaration("y", Generator.IdentifierName("x")) }),
1598
Generator.
StructDeclaration
("s", members: new[] { Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t")) }),
1602
Generator.
StructDeclaration
("s", members: new[] { Generator.ConstructorDeclaration("xxx") }),
1900
Generator.
StructDeclaration
("s"),
2030
Generator.
StructDeclaration
("s"),
2130
Generator.
StructDeclaration
("s"),
2717
AssertMemberNamesEqual("m", Generator.AddMembers(Generator.
StructDeclaration
("s"), new[] { Generator.MethodDeclaration("m") }));
2724
AssertMemberNamesEqual(new[] { "m", "m2" }, Generator.AddMembers(Generator.
StructDeclaration
("s", members: new[] { Generator.MethodDeclaration("m") }), new[] { Generator.MethodDeclaration("m2") }));
2736
TestRemoveAllMembers(Generator.
StructDeclaration
("s", members: new[] { Generator.MethodDeclaration("m") }));
2743
TestRemoveMember(Generator.
StructDeclaration
("s", members: new[] { Generator.MethodDeclaration("m1"), Generator.MethodDeclaration("m2") }), "m1", new[] { "m2" });
2759
AssertMemberNamesEqual("m", Generator.
StructDeclaration
("s", members: new[] { Generator.MethodDeclaration("m") }));
2771
Assert.Equal(DeclarationKind.Struct, Generator.GetDeclarationKind(Generator.
StructDeclaration
("s")));
2794
Assert.Equal("s", Generator.GetName(Generator.
StructDeclaration
("s")));
2817
Assert.Equal("s", Generator.GetName(Generator.WithName(Generator.
StructDeclaration
("x"), "s")));
2840
Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.
StructDeclaration
("s", accessibility: Accessibility.Internal)));
2864
Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.
StructDeclaration
("s", accessibility: Accessibility.Internal), Accessibility.Private)));
2889
Assert.Equal(DeclarationModifiers.Partial, Generator.GetModifiers(Generator.
StructDeclaration
("s", modifiers: DeclarationModifiers.Partial)));
2912
Assert.Equal(DeclarationModifiers.Partial, Generator.GetModifiers(Generator.WithModifiers(Generator.
StructDeclaration
("s"), DeclarationModifiers.Partial)));
2942
Generator.GetModifiers(Generator.WithModifiers(Generator.
StructDeclaration
("s"), allModifiers)));
3169
Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.
StructDeclaration
("c"), new[] { Generator.ParameterDeclaration("p", Generator.IdentifierName("t")) })).Count);
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (22)
CodeGeneration\SyntaxGeneratorTests.vb (22)
1434
Generator.
StructDeclaration
("s"),
1439
Generator.
StructDeclaration
("s", typeParameters:={"x", "y"}),
1444
Generator.
StructDeclaration
("s", accessibility:=Accessibility.Public, modifiers:=DeclarationModifiers.Partial),
1449
Generator.
StructDeclaration
("s", interfaceTypes:={Generator.IdentifierName("x")}),
1456
Generator.
StructDeclaration
("s", interfaceTypes:={Generator.IdentifierName("x"), Generator.IdentifierName("y")}),
1463
Generator.
StructDeclaration
("s", interfaceTypes:={}),
1468
Generator.
StructDeclaration
("s", members:={Generator.FieldDeclaration("y", Generator.IdentifierName("x"))}),
1475
Generator.
StructDeclaration
("s", members:={Generator.MethodDeclaration("m", returnType:=Generator.IdentifierName("t"))}),
1483
Generator.
StructDeclaration
("s",
1922
Generator.
StructDeclaration
("s"),
2059
Generator.
StructDeclaration
("s"),
2523
Assert.Equal(DeclarationKind.Struct, Generator.GetDeclarationKind(Generator.
StructDeclaration
("s")))
2548
Assert.Equal("s", Generator.GetName(Generator.
StructDeclaration
("s")))
2573
Assert.Equal("s", Generator.GetName(Generator.WithName(Generator.
StructDeclaration
("x"), "s")))
2598
Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.
StructDeclaration
("s", accessibility:=Accessibility.Internal)))
2626
Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.
StructDeclaration
("s", accessibility:=Accessibility.Internal), Accessibility.Private)))
2654
Assert.Equal(DeclarationModifiers.Partial, Generator.GetModifiers(Generator.
StructDeclaration
("s", modifiers:=DeclarationModifiers.Partial)))
2676
Assert.Equal(DeclarationModifiers.Partial, Generator.GetModifiers(Generator.WithModifiers(Generator.
StructDeclaration
("s"), DeclarationModifiers.Partial)))
3115
AssertMemberNamesEqual("m", Generator.
StructDeclaration
("s", members:={Generator.MethodDeclaration("m")}))
3125
AssertMemberNamesEqual("m", Generator.AddMembers(Generator.
StructDeclaration
("s"), {Generator.MethodDeclaration("m")}))
3132
AssertMemberNamesEqual({"m", "m2"}, Generator.AddMembers(Generator.
StructDeclaration
("s", members:={Generator.MethodDeclaration("m")}), {Generator.MethodDeclaration("m2")}))
3142
TestRemoveAllMembers(Generator.
StructDeclaration
("s", members:={Generator.MethodDeclaration("m")}))