44 references to DelegateDeclaration
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (21)
CodeGeneration\SyntaxGeneratorTests.cs (21)
1704Generator.DelegateDeclaration("d"),
1708Generator.DelegateDeclaration("d", returnType: Generator.IdentifierName("t")),
1716Generator.DelegateDeclaration("d", accessibility: Accessibility.Public),
1720Generator.DelegateDeclaration("d", accessibility: Accessibility.Public),
1724Generator.DelegateDeclaration("d", modifiers: DeclarationModifiers.New),
1912Generator.DelegateDeclaration("d"),
2042Generator.DelegateDeclaration("d"),
2146Generator.DelegateDeclaration("d"),
2878Assert.Equal(DeclarationKind.Delegate, Generator.GetDeclarationKind(Generator.DelegateDeclaration("d")));
2901Assert.Equal("d", Generator.GetName(Generator.DelegateDeclaration("d")));
2924Assert.Equal("d", Generator.GetName(Generator.WithName(Generator.DelegateDeclaration("x"), "d")));
2947Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.DelegateDeclaration("d", accessibility: Accessibility.Internal)));
2971Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.DelegateDeclaration("d", accessibility: Accessibility.Internal), Accessibility.Private)));
2995Assert.Equal(DeclarationModifiers.New, Generator.GetModifiers(Generator.DelegateDeclaration("d", modifiers: DeclarationModifiers.New)));
3018Assert.Equal(DeclarationModifiers.New, Generator.GetModifiers(Generator.WithModifiers(Generator.DelegateDeclaration("d"), DeclarationModifiers.New)));
3054Generator.GetModifiers(Generator.WithModifiers(Generator.DelegateDeclaration("d"), allModifiers)));
3205Assert.Equal("t", Generator.GetType(Generator.DelegateDeclaration("t", returnType: Generator.IdentifierName("t"))).ToString());
3206Assert.Null(Generator.GetType(Generator.DelegateDeclaration("d")));
3223Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.DelegateDeclaration("t"), Generator.IdentifierName("t"))).ToString());
3253Assert.Equal(0, Generator.GetParameters(Generator.DelegateDeclaration("d")).Count);
3270Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.DelegateDeclaration("d"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (23)
CodeGeneration\SyntaxGeneratorTests.vb (23)
1631Generator.DelegateDeclaration("d"),
1635Generator.DelegateDeclaration("d", parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))}),
1639Generator.DelegateDeclaration("d", returnType:=Generator.IdentifierName("t")),
1643Generator.DelegateDeclaration("d", parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))}, returnType:=Generator.IdentifierName("t")),
1647Generator.DelegateDeclaration("d", accessibility:=Accessibility.Public),
1652Generator.DelegateDeclaration("d", modifiers:=DeclarationModifiers.Static),
2253Generator.DelegateDeclaration("d"),
2570Assert.Equal(DeclarationKind.Delegate, Generator.GetDeclarationKind(Generator.DelegateDeclaration("d")))
2595Assert.Equal("d", Generator.GetName(Generator.DelegateDeclaration("d")))
2620Assert.Equal("d", Generator.GetName(Generator.WithName(Generator.DelegateDeclaration("x"), "d")))
2645Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.DelegateDeclaration("d", accessibility:=Accessibility.Internal)))
2673Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.DelegateDeclaration("d", accessibility:=Accessibility.Internal), Accessibility.Private)))
2700Assert.Equal(DeclarationModifiers.[New], Generator.GetModifiers(Generator.DelegateDeclaration("d", modifiers:=DeclarationModifiers.[New])))
2722Assert.Equal(DeclarationModifiers.[New], Generator.GetModifiers(Generator.WithModifiers(Generator.DelegateDeclaration("d"), DeclarationModifiers.[New])))
2775Assert.Equal("t", Generator.GetType(Generator.DelegateDeclaration("t", returnType:=Generator.IdentifierName("t"))).ToString())
2776Assert.Null(Generator.GetType(Generator.DelegateDeclaration("d")))
2793Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.DelegateDeclaration("t", returnType:=Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2794Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.DelegateDeclaration("t"), Generator.IdentifierName("t"))).ToString())
2825Generator.WithType(Generator.DelegateDeclaration("d", returnType:=Generator.IdentifierName("x")), Nothing),
2829Generator.WithType(Generator.DelegateDeclaration("d"), Generator.IdentifierName("x")),
2855Assert.Equal(0, Generator.GetParameters(Generator.DelegateDeclaration("d")).Count)
2856Assert.Equal(1, Generator.GetParameters(Generator.DelegateDeclaration("d", parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count)
2871Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.DelegateDeclaration("d"), {Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count)