1 override of ConstructorDeclaration
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
354
public override SyntaxNode
ConstructorDeclaration
(
40 references to ConstructorDeclaration
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (20)
CodeGeneration\SyntaxGeneratorTests.cs (20)
1008
Generator.
ConstructorDeclaration
(),
1012
Generator.
ConstructorDeclaration
("c"),
1016
Generator.
ConstructorDeclaration
("c", accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Static),
1566
Generator.ClassDeclaration("c", members: [Generator.
ConstructorDeclaration
()]),
1602
Generator.StructDeclaration("s", members: [Generator.
ConstructorDeclaration
("xxx")]),
2880
Assert.Equal(DeclarationKind.Constructor, Generator.GetDeclarationKind(Generator.
ConstructorDeclaration
()));
2903
Assert.Equal("", Generator.GetName(Generator.
ConstructorDeclaration
()));
2926
Assert.Equal("", Generator.GetName(Generator.WithName(Generator.
ConstructorDeclaration
(), ".ctor")));
2949
Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.
ConstructorDeclaration
(accessibility: Accessibility.Internal)));
2973
Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.
ConstructorDeclaration
(accessibility: Accessibility.Internal), Accessibility.Private)));
2997
Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.
ConstructorDeclaration
(modifiers: DeclarationModifiers.Static)));
3020
Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.WithModifiers(Generator.
ConstructorDeclaration
(), DeclarationModifiers.Static)));
3066
Generator.GetModifiers(Generator.WithModifiers(Generator.
ConstructorDeclaration
("c"), allModifiers)));
3100
var ctor = Generator.
ConstructorDeclaration
("C", modifiers: DeclarationModifiers.Static);
3114
var ctor = Generator.
ConstructorDeclaration
("C", accessibility: Accessibility.Public);
3240
Assert.Equal(0, Generator.GetParameters(Generator.
ConstructorDeclaration
()).Count);
3264
Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.
ConstructorDeclaration
(), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3544
Assert.Equal(0, Generator.GetStatements(Generator.
ConstructorDeclaration
()).Count);
3545
Assert.Equal(2, Generator.GetStatements(Generator.
ConstructorDeclaration
(statements: stmts)).Count);
3569
Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.
ConstructorDeclaration
(), stmts)).Count);
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (19)
CodeGeneration\SyntaxGeneratorTests.vb (19)
1372
Generator.
ConstructorDeclaration
("c"),
1377
Generator.
ConstructorDeclaration
("c", accessibility:=Accessibility.Public, modifiers:=DeclarationModifiers.Static),
1382
Generator.
ConstructorDeclaration
("c", parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))}),
1387
Generator.
ConstructorDeclaration
("c",
1501
members:={Generator.
ConstructorDeclaration
(accessibility:=Accessibility.NotApplicable, modifiers:=DeclarationModifiers.None)}),
2573
Assert.Equal(DeclarationKind.Constructor, Generator.GetDeclarationKind(Generator.
ConstructorDeclaration
()))
2598
Assert.Equal("", Generator.GetName(Generator.
ConstructorDeclaration
()))
2623
Assert.Equal("", Generator.GetName(Generator.WithName(Generator.
ConstructorDeclaration
(), ".ctor")))
2647
Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.
ConstructorDeclaration
(accessibility:=Accessibility.Internal)))
2675
Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.
ConstructorDeclaration
(accessibility:=Accessibility.Internal), Accessibility.Private)))
2702
Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.
ConstructorDeclaration
(modifiers:=DeclarationModifiers.Static)))
2724
Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.WithModifiers(Generator.
ConstructorDeclaration
(), DeclarationModifiers.Static)))
2840
Assert.Equal(0, Generator.GetParameters(Generator.
ConstructorDeclaration
()).Count)
2841
Assert.Equal(1, Generator.GetParameters(Generator.
ConstructorDeclaration
(parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count)
2842
Assert.Equal(2, Generator.GetParameters(Generator.
ConstructorDeclaration
(parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))})).Count)
2865
Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.
ConstructorDeclaration
(), {Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count)
2968
Assert.Equal(0, Generator.GetStatements(Generator.
ConstructorDeclaration
()).Count)
2969
Assert.Equal(2, Generator.GetStatements(Generator.
ConstructorDeclaration
(statements:=stmts)).Count)
2987
Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.
ConstructorDeclaration
(), stmts)).Count)
Microsoft.CodeAnalysis.Workspaces (1)
Editing\SyntaxGenerator.cs (1)
559
return
ConstructorDeclaration
(