CodeGeneration\SyntaxGeneratorTests.cs (2455)
66VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0), "0");
67VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1), "1");
68VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.LiteralExpression(-1), "-1");
69VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(int.MinValue), "global::System.Int32.MinValue");
70VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(int.MaxValue), "global::System.Int32.MaxValue");
72VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0L), "0L");
73VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1L), "1L");
74VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.LiteralExpression(-1L), "-1L");
75VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(long.MinValue), "global::System.Int64.MinValue");
76VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(long.MaxValue), "global::System.Int64.MaxValue");
78VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0UL), "0UL");
79VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1UL), "1UL");
80VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(ulong.MinValue), "0UL");
81VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(ulong.MaxValue), "global::System.UInt64.MaxValue");
83VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0.0f), "0F");
84VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1.0f), "1F");
85VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.LiteralExpression(-1.0f), "-1F");
86VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(float.MinValue), "global::System.Single.MinValue");
87VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(float.MaxValue), "global::System.Single.MaxValue");
88VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(float.Epsilon), "global::System.Single.Epsilon");
89VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(float.NaN), "global::System.Single.NaN");
90VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(float.NegativeInfinity), "global::System.Single.NegativeInfinity");
91VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(float.PositiveInfinity), "global::System.Single.PositiveInfinity");
93VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0.0), "0D");
94VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1.0), "1D");
95VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.LiteralExpression(-1.0), "-1D");
96VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(double.MinValue), "global::System.Double.MinValue");
97VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(double.MaxValue), "global::System.Double.MaxValue");
98VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(double.Epsilon), "global::System.Double.Epsilon");
99VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(double.NaN), "global::System.Double.NaN");
100VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(double.NegativeInfinity), "global::System.Double.NegativeInfinity");
101VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(double.PositiveInfinity), "global::System.Double.PositiveInfinity");
103VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0m), "0M");
104VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0.00m), "0.00M");
105VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1.00m), "1.00M");
106VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.LiteralExpression(-1.00m), "-1.00M");
107VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1.0000000000m), "1.0000000000M");
108VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0.000000m), "0.000000M");
109VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0.0000000m), "0.0000000M");
110VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1000000000m), "1000000000M");
111VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(123456789.123456789m), "123456789.123456789M");
112VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1E-28m), "0.0000000000000000000000000001M");
113VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0E-28m), "0.0000000000000000000000000000M");
114VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1E-29m), "0.0000000000000000000000000000M");
115VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(-1E-29m), "0.0000000000000000000000000000M");
116VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(decimal.MinValue), "global::System.Decimal.MinValue");
117VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(decimal.MaxValue), "global::System.Decimal.MaxValue");
119VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression('c'), "'c'");
121VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression("str"), "\"str\"");
122VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression("s\"t\"r"), "\"s\\\"t\\\"r\"");
124VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(true), "true");
125VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(false), "false");
131VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((short)0), "0");
132VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((short)1), "1");
133VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.LiteralExpression((short)-1), "-1");
134VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(short.MinValue), "global::System.Int16.MinValue");
135VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(short.MaxValue), "global::System.Int16.MaxValue");
141VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((ushort)0), "0");
142VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((ushort)1), "1");
143VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(ushort.MinValue), "0");
144VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(ushort.MaxValue), "global::System.UInt16.MaxValue");
150VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((sbyte)0), "0");
151VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((sbyte)1), "1");
152VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.LiteralExpression((sbyte)-1), "-1");
153VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(sbyte.MinValue), "global::System.SByte.MinValue");
154VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(sbyte.MaxValue), "global::System.SByte.MaxValue");
160VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((byte)0), "0");
161VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((byte)1), "1");
162VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(byte.MinValue), "0");
163VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(byte.MaxValue), "255");
169VerifySyntax<AttributeListSyntax>(Generator.Attribute(GetAttributeData(
175VerifySyntax<AttributeListSyntax>(Generator.Attribute(GetAttributeData(
181VerifySyntax<AttributeListSyntax>(Generator.Attribute(GetAttributeData(
187VerifySyntax<AttributeListSyntax>(Generator.Attribute(GetAttributeData(
193VerifySyntax<AttributeListSyntax>(Generator.Attribute(GetAttributeData(
199VerifySyntax<AttributeListSyntax>(Generator.Attribute(GetAttributeData(
206VerifySyntax<AttributeListSyntax>(Generator.Attribute(GetAttributeData(
212VerifySyntax<AttributeListSyntax>(Generator.Attribute(GetAttributeData(
218VerifySyntax<AttributeListSyntax>(Generator.Attribute(GetAttributeData(
224var attributes = Generator.GetAttributes(Generator.AddAttributes(
225Generator.NamespaceDeclaration("n"),
226Generator.Attribute("Attr")));
240VerifySyntax<IdentifierNameSyntax>(Generator.IdentifierName("x"), "x");
241VerifySyntax<QualifiedNameSyntax>(Generator.QualifiedName(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "x.y");
242VerifySyntax<QualifiedNameSyntax>(Generator.DottedName("x.y"), "x.y");
244VerifySyntax<GenericNameSyntax>(Generator.GenericName("x", Generator.IdentifierName("y")), "x<y>");
245VerifySyntax<GenericNameSyntax>(Generator.GenericName("x", Generator.IdentifierName("y"), Generator.IdentifierName("z")), "x<y, z>");
248VerifySyntax<GenericNameSyntax>(Generator.WithTypeArguments(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "x<y>");
251VerifySyntax<QualifiedNameSyntax>(Generator.WithTypeArguments(Generator.DottedName("x.y"), Generator.IdentifierName("z")), "x.y<z>");
254VerifySyntax<MemberAccessExpressionSyntax>(Generator.WithTypeArguments(Generator.MemberAccessExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), Generator.IdentifierName("z")), "x.y<z>");
257var gname = Generator.WithTypeArguments(Generator.IdentifierName("x"), Generator.IdentifierName("y"));
259VerifySyntax<GenericNameSyntax>(Generator.WithTypeArguments(gname, Generator.IdentifierName("z")), "x<z>");
266VerifySyntax<TypeSyntax>(Generator.IdentifierName("x"), "x");
267VerifySyntax<TypeSyntax>(Generator.QualifiedName(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "x.y");
268VerifySyntax<TypeSyntax>(Generator.DottedName("x.y"), "x.y");
269VerifySyntax<TypeSyntax>(Generator.GenericName("x", Generator.IdentifierName("y")), "x<y>");
270VerifySyntax<TypeSyntax>(Generator.GenericName("x", Generator.IdentifierName("y"), Generator.IdentifierName("z")), "x<y, z>");
272VerifySyntax<TypeSyntax>(Generator.ArrayTypeExpression(Generator.IdentifierName("x")), "x[]");
273VerifySyntax<TypeSyntax>(Generator.ArrayTypeExpression(Generator.ArrayTypeExpression(Generator.IdentifierName("x"))), "x[][]");
274VerifySyntax<TypeSyntax>(Generator.NullableTypeExpression(Generator.IdentifierName("x")), "x?");
275VerifySyntax<TypeSyntax>(Generator.NullableTypeExpression(Generator.NullableTypeExpression(Generator.IdentifierName("x"))), "x?");
278VerifySyntax<TupleElementSyntax>(Generator.TupleElementExpression(Generator.IdentifierName("x")), "x");
279VerifySyntax<TupleElementSyntax>(Generator.TupleElementExpression(Generator.IdentifierName("x"), "y"), "x y");
280VerifySyntax<TupleElementSyntax>(Generator.TupleElementExpression(intType), "global::System.Int32");
281VerifySyntax<TupleElementSyntax>(Generator.TupleElementExpression(intType, "y"), "global::System.Int32 y");
282VerifySyntax<TypeSyntax>(Generator.TupleTypeExpression(Generator.TupleElementExpression(Generator.IdentifierName("x")), Generator.TupleElementExpression(Generator.IdentifierName("y"))), "(x, y)");
283VerifySyntax<TypeSyntax>(Generator.TupleTypeExpression(new[] { intType, intType }), "(global::System.Int32, global::System.Int32)");
284VerifySyntax<TypeSyntax>(Generator.TupleTypeExpression(new[] { intType, intType }, ["x", "y"]), "(global::System.Int32 x, global::System.Int32 y)");
290VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Byte), "byte");
291VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_SByte), "sbyte");
293VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Int16), "short");
294VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_UInt16), "ushort");
296VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Int32), "int");
297VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_UInt32), "uint");
299VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Int64), "long");
300VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_UInt64), "ulong");
302VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Single), "float");
303VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Double), "double");
305VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Char), "char");
306VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_String), "string");
308VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Object), "object");
309VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Decimal), "decimal");
316VerifySyntax<QualifiedNameSyntax>(Generator.TypeExpression(genericType), "global::System.Collections.Generic.IEnumerable<T>");
319VerifySyntax<ArrayTypeSyntax>(Generator.TypeExpression(arrayType), "global::System.Int32[]");
325VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.NegateExpression(Generator.IdentifierName("x")), "-(x)");
326VerifySyntax<BinaryExpressionSyntax>(Generator.AddExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) + (y)");
327VerifySyntax<BinaryExpressionSyntax>(Generator.SubtractExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) - (y)");
328VerifySyntax<BinaryExpressionSyntax>(Generator.MultiplyExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) * (y)");
329VerifySyntax<BinaryExpressionSyntax>(Generator.DivideExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) / (y)");
330VerifySyntax<BinaryExpressionSyntax>(Generator.ModuloExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) % (y)");
332VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.BitwiseNotExpression(Generator.IdentifierName("x")), "~(x)");
333VerifySyntax<BinaryExpressionSyntax>(Generator.BitwiseAndExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) & (y)");
334VerifySyntax<BinaryExpressionSyntax>(Generator.BitwiseOrExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) | (y)");
336VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.LogicalNotExpression(Generator.IdentifierName("x")), "!(x)");
337VerifySyntax<BinaryExpressionSyntax>(Generator.LogicalAndExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) && (y)");
338VerifySyntax<BinaryExpressionSyntax>(Generator.LogicalOrExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) || (y)");
344VerifySyntax<BinaryExpressionSyntax>(Generator.ReferenceEqualsExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) == (y)");
345VerifySyntax<BinaryExpressionSyntax>(Generator.ValueEqualsExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) == (y)");
347VerifySyntax<BinaryExpressionSyntax>(Generator.ReferenceNotEqualsExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) != (y)");
348VerifySyntax<BinaryExpressionSyntax>(Generator.ValueNotEqualsExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) != (y)");
350VerifySyntax<BinaryExpressionSyntax>(Generator.LessThanExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) < (y)");
351VerifySyntax<BinaryExpressionSyntax>(Generator.LessThanOrEqualExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) <= (y)");
353VerifySyntax<BinaryExpressionSyntax>(Generator.GreaterThanExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) > (y)");
354VerifySyntax<BinaryExpressionSyntax>(Generator.GreaterThanOrEqualExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) >= (y)");
360VerifySyntax<BinaryExpressionSyntax>(Generator.CoalesceExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) ?? (y)");
361VerifySyntax<ConditionalExpressionSyntax>(Generator.ConditionalExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y"), Generator.IdentifierName("z")), "(x) ? (y) : (z)");
367VerifySyntax<MemberAccessExpressionSyntax>(Generator.MemberAccessExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "x.y");
368VerifySyntax<MemberAccessExpressionSyntax>(Generator.MemberAccessExpression(Generator.IdentifierName("x"), "y"), "x.y");
369VerifySyntax<MemberAccessExpressionSyntax>(Generator.MemberAccessExpression(Generator.MemberAccessExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), Generator.IdentifierName("z")), "x.y.z");
370VerifySyntax<MemberAccessExpressionSyntax>(Generator.MemberAccessExpression(Generator.InvocationExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), Generator.IdentifierName("z")), "x(y).z");
371VerifySyntax<MemberAccessExpressionSyntax>(Generator.MemberAccessExpression(Generator.ElementAccessExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), Generator.IdentifierName("z")), "x[y].z");
372VerifySyntax<MemberAccessExpressionSyntax>(Generator.MemberAccessExpression(Generator.AddExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), Generator.IdentifierName("z")), "((x) + (y)).z");
373VerifySyntax<MemberAccessExpressionSyntax>(Generator.MemberAccessExpression(Generator.NegateExpression(Generator.IdentifierName("x")), Generator.IdentifierName("y")), "(-(x)).y");
380Generator.ArrayCreationExpression(Generator.IdentifierName("x"), Generator.LiteralExpression(10)),
384Generator.ArrayCreationExpression(Generator.IdentifierName("x"), new SyntaxNode[] { Generator.IdentifierName("y"), Generator.IdentifierName("z") }),
398Generator.ObjectCreationExpression(Generator.IdentifierName("x")),
402Generator.ObjectCreationExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")),
410Generator.ObjectCreationExpression(listOfIntType, Generator.IdentifierName("y")),
418Generator.ElementAccessExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")),
422Generator.ElementAccessExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y"), Generator.IdentifierName("z")),
426Generator.ElementAccessExpression(Generator.MemberAccessExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), Generator.IdentifierName("z")),
430Generator.ElementAccessExpression(Generator.ElementAccessExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), Generator.IdentifierName("z")),
434Generator.ElementAccessExpression(Generator.InvocationExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), Generator.IdentifierName("z")),
438Generator.ElementAccessExpression(Generator.AddExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), Generator.IdentifierName("z")),
445VerifySyntax<CastExpressionSyntax>(Generator.CastExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x)(y)");
446VerifySyntax<CastExpressionSyntax>(Generator.ConvertExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x)(y)");
452VerifySyntax<BinaryExpressionSyntax>(Generator.IsTypeExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) is y");
453VerifySyntax<BinaryExpressionSyntax>(Generator.TryCastExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "(x) as y");
454VerifySyntax<TypeOfExpressionSyntax>(Generator.TypeOfExpression(Generator.IdentifierName("x")), "typeof(x)");
461VerifySyntax<InvocationExpressionSyntax>(Generator.InvocationExpression(Generator.IdentifierName("x")), "x()");
462VerifySyntax<InvocationExpressionSyntax>(Generator.InvocationExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "x(y)");
463VerifySyntax<InvocationExpressionSyntax>(Generator.InvocationExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y"), Generator.IdentifierName("z")), "x(y, z)");
466VerifySyntax<InvocationExpressionSyntax>(Generator.InvocationExpression(Generator.IdentifierName("x"), Generator.Argument(Generator.IdentifierName("y"))), "x(y)");
467VerifySyntax<InvocationExpressionSyntax>(Generator.InvocationExpression(Generator.IdentifierName("x"), Generator.Argument(RefKind.Ref, Generator.IdentifierName("y"))), "x(ref y)");
468VerifySyntax<InvocationExpressionSyntax>(Generator.InvocationExpression(Generator.IdentifierName("x"), Generator.Argument(RefKind.Out, Generator.IdentifierName("y"))), "x(out y)");
471VerifySyntax<InvocationExpressionSyntax>(Generator.InvocationExpression(Generator.MemberAccessExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y"))), "x.y()");
472VerifySyntax<InvocationExpressionSyntax>(Generator.InvocationExpression(Generator.ElementAccessExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y"))), "x[y]()");
473VerifySyntax<InvocationExpressionSyntax>(Generator.InvocationExpression(Generator.InvocationExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y"))), "x(y)()");
474VerifySyntax<InvocationExpressionSyntax>(Generator.InvocationExpression(Generator.AddExpression(Generator.IdentifierName("x"), Generator.IdentifierName("y"))), "((x) + (y))()");
479=> VerifySyntax<AssignmentExpressionSyntax>(Generator.AssignmentStatement(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "x = (y)");
484VerifySyntax<ExpressionStatementSyntax>(Generator.ExpressionStatement(Generator.IdentifierName("x")), "x;");
485VerifySyntax<ExpressionStatementSyntax>(Generator.ExpressionStatement(Generator.InvocationExpression(Generator.IdentifierName("x"))), "x();");
491VerifySyntax<LocalDeclarationStatementSyntax>(Generator.LocalDeclarationStatement(Generator.IdentifierName("x"), "y"), "x y;");
492VerifySyntax<LocalDeclarationStatementSyntax>(Generator.LocalDeclarationStatement(Generator.IdentifierName("x"), "y", Generator.IdentifierName("z")), "x y = z;");
494VerifySyntax<LocalDeclarationStatementSyntax>(Generator.LocalDeclarationStatement(Generator.IdentifierName("x"), "y", isConst: true), "const x y;");
495VerifySyntax<LocalDeclarationStatementSyntax>(Generator.LocalDeclarationStatement(Generator.IdentifierName("x"), "y", Generator.IdentifierName("z"), isConst: true), "const x y = z;");
497VerifySyntax<LocalDeclarationStatementSyntax>(Generator.LocalDeclarationStatement("y", Generator.IdentifierName("z")), "var y = z;");
504Generator.AddEventHandler(Generator.IdentifierName("@event"), Generator.IdentifierName("handler")),
512Generator.RemoveEventHandler(Generator.IdentifierName("@event"),
513Generator.IdentifierName("handler")), "@event -= (handler)");
518=> VerifySyntax<AwaitExpressionSyntax>(Generator.AwaitExpression(Generator.IdentifierName("x")), "await x");
522=> VerifySyntax<InvocationExpressionSyntax>(Generator.NameOfExpression(Generator.IdentifierName("x")), "nameof(x)");
527VerifySyntax<TupleExpressionSyntax>(Generator.TupleExpression(
528[Generator.IdentifierName("x"), Generator.IdentifierName("y")]), "(x, y)");
530VerifySyntax<TupleExpressionSyntax>(Generator.TupleExpression([
531Generator.Argument("goo", RefKind.None, Generator.IdentifierName("x")),
532Generator.Argument("bar", RefKind.None, Generator.IdentifierName("y"))]), "(goo: x, bar: y)");
538VerifySyntax<ReturnStatementSyntax>(Generator.ReturnStatement(), "return;");
539VerifySyntax<ReturnStatementSyntax>(Generator.ReturnStatement(Generator.IdentifierName("x")), "return x;");
545VerifySyntax<YieldStatementSyntax>(Generator.YieldReturnStatement(Generator.LiteralExpression(1)), "yield return 1;");
546VerifySyntax<YieldStatementSyntax>(Generator.YieldReturnStatement(Generator.IdentifierName("x")), "yield return x;");
552VerifySyntax<ThrowStatementSyntax>(Generator.ThrowStatement(), "throw;");
553VerifySyntax<ThrowStatementSyntax>(Generator.ThrowStatement(Generator.IdentifierName("x")), "throw x;");
560Generator.IfStatement(Generator.IdentifierName("x"), new SyntaxNode[] { }),
564Generator.IfStatement(Generator.IdentifierName("x"), new SyntaxNode[] { }, new SyntaxNode[] { }),
568Generator.IfStatement(Generator.IdentifierName("x"),
569new SyntaxNode[] { Generator.IdentifierName("y") }),
573Generator.IfStatement(Generator.IdentifierName("x"),
574new SyntaxNode[] { Generator.IdentifierName("y") },
575new SyntaxNode[] { Generator.IdentifierName("z") }),
579Generator.IfStatement(Generator.IdentifierName("x"),
580new SyntaxNode[] { Generator.IdentifierName("y") },
581Generator.IfStatement(Generator.IdentifierName("p"), new SyntaxNode[] { Generator.IdentifierName("q") })),
585Generator.IfStatement(Generator.IdentifierName("x"),
586new SyntaxNode[] { Generator.IdentifierName("y") },
587Generator.IfStatement(Generator.IdentifierName("p"), new SyntaxNode[] { Generator.IdentifierName("q") }, Generator.IdentifierName("z"))),
595Generator.SwitchStatement(Generator.IdentifierName("x"),
596Generator.SwitchSection(Generator.IdentifierName("y"),
597[Generator.IdentifierName("z")])),
601Generator.SwitchStatement(Generator.IdentifierName("x"),
602Generator.SwitchSection(
603[Generator.IdentifierName("y"), Generator.IdentifierName("p"), Generator.IdentifierName("q")],
604[Generator.IdentifierName("z")])),
608Generator.SwitchStatement(Generator.IdentifierName("x"),
609Generator.SwitchSection(Generator.IdentifierName("y"),
610[Generator.IdentifierName("z")]),
611Generator.SwitchSection(Generator.IdentifierName("a"),
612[Generator.IdentifierName("b")])),
616Generator.SwitchStatement(Generator.IdentifierName("x"),
617Generator.SwitchSection(Generator.IdentifierName("y"),
618[Generator.IdentifierName("z")]),
619Generator.DefaultSwitchSection(
620[Generator.IdentifierName("b")])),
624Generator.SwitchStatement(Generator.IdentifierName("x"),
625Generator.SwitchSection(Generator.IdentifierName("y"),
626[Generator.ExitSwitchStatement()])),
630Generator.SwitchStatement(Generator.TupleExpression([Generator.IdentifierName("x1"), Generator.IdentifierName("x2")]),
631Generator.SwitchSection(Generator.IdentifierName("y"),
632[Generator.IdentifierName("z")])),
641Generator.UsingStatement(Generator.IdentifierName("x"), [Generator.IdentifierName("y")]),
645Generator.UsingStatement("x", Generator.IdentifierName("y"), [Generator.IdentifierName("z")]),
649Generator.UsingStatement(Generator.IdentifierName("x"), "y", Generator.IdentifierName("z"), [Generator.IdentifierName("q")]),
657Generator.LockStatement(Generator.IdentifierName("x"), [Generator.IdentifierName("y")]),
665Generator.TryCatchStatement(
666[Generator.IdentifierName("x")],
667Generator.CatchClause(Generator.IdentifierName("y"), "z",
668[Generator.IdentifierName("a")])),
672Generator.TryCatchStatement(
673[Generator.IdentifierName("s")],
674Generator.CatchClause(Generator.IdentifierName("x"), "y",
675[Generator.IdentifierName("z")]),
676Generator.CatchClause(Generator.IdentifierName("a"), "b",
677[Generator.IdentifierName("c")])),
681Generator.TryCatchStatement(
682[Generator.IdentifierName("s")],
683[Generator.CatchClause(Generator.IdentifierName("x"), "y", [Generator.IdentifierName("z")])],
684[Generator.IdentifierName("a")]),
688Generator.TryFinallyStatement(
689[Generator.IdentifierName("x")],
690[Generator.IdentifierName("a")]),
698Generator.WhileStatement(Generator.IdentifierName("x"),
699[Generator.IdentifierName("y")]),
703Generator.WhileStatement(Generator.IdentifierName("x"), null),
711Generator.ValueReturningLambdaExpression("x", Generator.IdentifierName("y")),
715Generator.ValueReturningLambdaExpression(new[] { Generator.LambdaParameter("x"), Generator.LambdaParameter("y") }, Generator.IdentifierName("z")),
719Generator.ValueReturningLambdaExpression(new SyntaxNode[] { }, Generator.IdentifierName("y")),
723Generator.VoidReturningLambdaExpression("x", Generator.IdentifierName("y")),
727Generator.VoidReturningLambdaExpression(new[] { Generator.LambdaParameter("x"), Generator.LambdaParameter("y") }, Generator.IdentifierName("z")),
731Generator.VoidReturningLambdaExpression(new SyntaxNode[] { }, Generator.IdentifierName("y")),
735Generator.ValueReturningLambdaExpression("x", [Generator.ReturnStatement(Generator.IdentifierName("y"))]),
739Generator.ValueReturningLambdaExpression(new[] { Generator.LambdaParameter("x"), Generator.LambdaParameter("y") }, [Generator.ReturnStatement(Generator.IdentifierName("z"))]),
743Generator.ValueReturningLambdaExpression(new SyntaxNode[] { }, [Generator.ReturnStatement(Generator.IdentifierName("y"))]),
747Generator.VoidReturningLambdaExpression("x", [Generator.IdentifierName("y")]),
751Generator.VoidReturningLambdaExpression(new[] { Generator.LambdaParameter("x"), Generator.LambdaParameter("y") }, [Generator.IdentifierName("z")]),
755Generator.VoidReturningLambdaExpression(new SyntaxNode[] { }, [Generator.IdentifierName("y")]),
759Generator.ValueReturningLambdaExpression(new[] { Generator.LambdaParameter("x", Generator.IdentifierName("y")) }, Generator.IdentifierName("z")),
763Generator.ValueReturningLambdaExpression(new[] { Generator.LambdaParameter("x", Generator.IdentifierName("y")), Generator.LambdaParameter("a", Generator.IdentifierName("b")) }, Generator.IdentifierName("z")),
767Generator.VoidReturningLambdaExpression(new[] { Generator.LambdaParameter("x", Generator.IdentifierName("y")) }, Generator.IdentifierName("z")),
771Generator.VoidReturningLambdaExpression(new[] { Generator.LambdaParameter("x", Generator.IdentifierName("y")), Generator.LambdaParameter("a", Generator.IdentifierName("b")) }, Generator.IdentifierName("z")),
781Generator.FieldDeclaration("fld", Generator.TypeExpression(SpecialType.System_Int32)),
785Generator.FieldDeclaration("fld", Generator.TypeExpression(SpecialType.System_Int32), initializer: Generator.LiteralExpression(0)),
789Generator.FieldDeclaration("fld", Generator.TypeExpression(SpecialType.System_Int32), accessibility: Accessibility.Public),
793Generator.FieldDeclaration("fld", Generator.TypeExpression(SpecialType.System_Int32), accessibility: Accessibility.NotApplicable, modifiers: DeclarationModifiers.Static | DeclarationModifiers.ReadOnly),
797Generator.FieldDeclaration("fld", Generator.TypeExpression(SpecialType.System_Int32), accessibility: Accessibility.NotApplicable, modifiers: DeclarationModifiers.Required),
805Generator.MethodDeclaration("m"),
809Generator.MethodDeclaration("m", typeParameters: ["x", "y"]),
813Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("x")),
817Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("x"), statements: [Generator.IdentifierName("y")]),
821Generator.MethodDeclaration("m", parameters: [Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], returnType: Generator.IdentifierName("x")),
825Generator.MethodDeclaration("m", parameters: [Generator.ParameterDeclaration("z", Generator.IdentifierName("y"), Generator.IdentifierName("a"))], returnType: Generator.IdentifierName("x")),
829Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("x"), accessibility: Accessibility.Public),
833Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("x"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Abstract),
837Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Partial),
841Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Partial, statements: [Generator.IdentifierName("y")]),
845Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Partial | DeclarationModifiers.Async, statements: null),
857var parameters = parameterTypes.Select((t, i) => Generator.ParameterDeclaration("p" + i, Generator.TypeExpression(t))).ToList();
858var returnType = Generator.TypeExpression(SpecialType.System_Boolean);
861Generator.OperatorDeclaration(OperatorKind.Addition, parameters, returnType),
865Generator.OperatorDeclaration(OperatorKind.BitwiseAnd, parameters, returnType),
869Generator.OperatorDeclaration(OperatorKind.BitwiseOr, parameters, returnType),
873Generator.OperatorDeclaration(OperatorKind.Decrement, parameters, returnType),
877Generator.OperatorDeclaration(OperatorKind.Division, parameters, returnType),
881Generator.OperatorDeclaration(OperatorKind.Equality, parameters, returnType),
885Generator.OperatorDeclaration(OperatorKind.ExclusiveOr, parameters, returnType),
889Generator.OperatorDeclaration(OperatorKind.False, parameters, returnType),
893Generator.OperatorDeclaration(OperatorKind.GreaterThan, parameters, returnType),
897Generator.OperatorDeclaration(OperatorKind.GreaterThanOrEqual, parameters, returnType),
901Generator.OperatorDeclaration(OperatorKind.Increment, parameters, returnType),
905Generator.OperatorDeclaration(OperatorKind.Inequality, parameters, returnType),
909Generator.OperatorDeclaration(OperatorKind.LeftShift, parameters, returnType),
913Generator.OperatorDeclaration(OperatorKind.LessThan, parameters, returnType),
917Generator.OperatorDeclaration(OperatorKind.LessThanOrEqual, parameters, returnType),
921Generator.OperatorDeclaration(OperatorKind.LogicalNot, parameters, returnType),
925Generator.OperatorDeclaration(OperatorKind.Modulus, parameters, returnType),
929Generator.OperatorDeclaration(OperatorKind.Multiply, parameters, returnType),
933Generator.OperatorDeclaration(OperatorKind.OnesComplement, parameters, returnType),
937Generator.OperatorDeclaration(OperatorKind.RightShift, parameters, returnType),
941Generator.OperatorDeclaration(OperatorKind.UnsignedRightShift, parameters, returnType),
945Generator.OperatorDeclaration(OperatorKind.Subtraction, parameters, returnType),
949Generator.OperatorDeclaration(OperatorKind.True, parameters, returnType),
953Generator.OperatorDeclaration(OperatorKind.UnaryNegation, parameters, returnType),
957Generator.OperatorDeclaration(OperatorKind.UnaryPlus, parameters, returnType),
963Generator.OperatorDeclaration(OperatorKind.ImplicitConversion, parameters, returnType),
967Generator.OperatorDeclaration(OperatorKind.ExplicitConversion, parameters, returnType),
982VerifySyntax<OperatorDeclarationSyntax>(Generator.OperatorDeclaration(operatorSymbol), "public static global::C operator checked ++(global::C x)\r\n{\r\n}");
993Generator.Declaration(conversion),
1000Generator.Declaration(conversion),
1008Generator.ConstructorDeclaration(),
1012Generator.ConstructorDeclaration("c"),
1016Generator.ConstructorDeclaration("c", accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Static),
1020Generator.ConstructorDeclaration("c", [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))]),
1024Generator.ConstructorDeclaration("c",
1025parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))],
1026baseConstructorArguments: [Generator.IdentifierName("p")]),
1034Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers: DeclarationModifiers.Abstract | DeclarationModifiers.ReadOnly),
1038Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers: DeclarationModifiers.Abstract | DeclarationModifiers.WriteOnly),
1042Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers: DeclarationModifiers.ReadOnly),
1046Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers: DeclarationModifiers.ReadOnly, getAccessorStatements: []),
1050Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers: DeclarationModifiers.WriteOnly),
1054Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers: DeclarationModifiers.WriteOnly, setAccessorStatements: []),
1058Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers: DeclarationModifiers.Abstract),
1062Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers: DeclarationModifiers.Required),
1066Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers: DeclarationModifiers.ReadOnly, getAccessorStatements: [Generator.IdentifierName("y")]),
1070Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers: DeclarationModifiers.WriteOnly, setAccessorStatements: [Generator.IdentifierName("y")]),
1074Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), setAccessorStatements: [Generator.IdentifierName("y")]),
1078Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), getAccessorStatements: [], setAccessorStatements: [Generator.IdentifierName("y")]),
1086Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.Abstract | DeclarationModifiers.ReadOnly),
1090Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.Abstract | DeclarationModifiers.WriteOnly),
1094Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.Abstract),
1098Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.ReadOnly),
1102Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.WriteOnly),
1106Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.ReadOnly,
1107getAccessorStatements: [Generator.IdentifierName("a")]),
1111Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.WriteOnly,
1112setAccessorStatements: [Generator.IdentifierName("a")]),
1116Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x")),
1120Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"),
1121setAccessorStatements: [Generator.IdentifierName("a")]),
1125Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"),
1126getAccessorStatements: [Generator.IdentifierName("a")], setAccessorStatements: [Generator.IdentifierName("b")]),
1134Generator.EventDeclaration("ef", Generator.IdentifierName("t")),
1138Generator.EventDeclaration("ef", Generator.IdentifierName("t"), accessibility: Accessibility.Public),
1142Generator.EventDeclaration("ef", Generator.IdentifierName("t"), modifiers: DeclarationModifiers.Static),
1150Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"), modifiers: DeclarationModifiers.Abstract),
1154Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Abstract),
1158Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t")),
1162Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"), addAccessorStatements: [Generator.IdentifierName("s")], removeAccessorStatements: [Generator.IdentifierName("s2")]),
1170Generator.AsPublicInterfaceImplementation(
1171Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"), modifiers: DeclarationModifiers.Abstract),
1172Generator.IdentifierName("i")),
1176Generator.AsPublicInterfaceImplementation(
1177Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility: Accessibility.Private, modifiers: DeclarationModifiers.Abstract),
1178Generator.IdentifierName("i")),
1182Generator.AsPublicInterfaceImplementation(
1183Generator.IndexerDeclaration(parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("a"))], type: Generator.IdentifierName("t"), accessibility: Accessibility.Internal, modifiers: DeclarationModifiers.Abstract),
1184Generator.IdentifierName("i")),
1188var pim = Generator.AsPrivateInterfaceImplementation(
1189Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"), accessibility: Accessibility.Private, modifiers: DeclarationModifiers.Abstract),
1190Generator.IdentifierName("i"));
1193Generator.AsPublicInterfaceImplementation(pim, Generator.IdentifierName("i2")),
1197Generator.AsPublicInterfaceImplementation(pim, Generator.IdentifierName("i2"), "m2"),
1202Generator.AsPublicInterfaceImplementation(
1233Generator.IdentifierName("i")),
1237Generator.AsPublicInterfaceImplementation(
1272Generator.IdentifierName("i")),
1276Generator.AsPublicInterfaceImplementation(
1333Generator.IdentifierName("i")),
1337Generator.AsPublicInterfaceImplementation(
1353Generator.IdentifierName("i")),
1357Generator.AsPublicInterfaceImplementation(
1377Generator.IdentifierName("i")),
1381Generator.AsPublicInterfaceImplementation(
1403Generator.IdentifierName("i")),
1407Generator.AsPublicInterfaceImplementation(
1434Generator.IdentifierName("i")),
1438Generator.AsPublicInterfaceImplementation(
1464Generator.IdentifierName("i")),
1473Generator.AsPrivateInterfaceImplementation(
1474Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"), accessibility: Accessibility.Private, modifiers: DeclarationModifiers.Abstract),
1475Generator.IdentifierName("i")),
1479Generator.AsPrivateInterfaceImplementation(
1480Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility: Accessibility.Internal, modifiers: DeclarationModifiers.Abstract),
1481Generator.IdentifierName("i")),
1485Generator.AsPrivateInterfaceImplementation(
1486Generator.IndexerDeclaration(parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("a"))], type: Generator.IdentifierName("t"), accessibility: Accessibility.Protected, modifiers: DeclarationModifiers.Abstract),
1487Generator.IdentifierName("i")),
1491Generator.AsPrivateInterfaceImplementation(
1492Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"), modifiers: DeclarationModifiers.Abstract),
1493Generator.IdentifierName("i")),
1497var pim = Generator.AsPublicInterfaceImplementation(
1498Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"), accessibility: Accessibility.Private, modifiers: DeclarationModifiers.Abstract),
1499Generator.IdentifierName("i"));
1502Generator.AsPrivateInterfaceImplementation(pim, Generator.IdentifierName("i2")),
1506Generator.AsPrivateInterfaceImplementation(pim, Generator.IdentifierName("i2"), "m2"),
1521var method = Generator.GetMembers(iface)[0];
1523var privateMethod = Generator.AsPrivateInterfaceImplementation(method, Generator.IdentifierName("IFace"));
1534Generator.ClassDeclaration("c"),
1538Generator.ClassDeclaration("c", typeParameters: ["x", "y"]),
1542Generator.ClassDeclaration("c", baseType: Generator.IdentifierName("x")),
1546Generator.ClassDeclaration("c", interfaceTypes: [Generator.IdentifierName("x")]),
1550Generator.ClassDeclaration("c", baseType: Generator.IdentifierName("x"), interfaceTypes: [Generator.IdentifierName("y")]),
1554Generator.ClassDeclaration("c", interfaceTypes: new SyntaxNode[] { }),
1558Generator.ClassDeclaration("c", members: [Generator.FieldDeclaration("y", type: Generator.IdentifierName("x"))]),
1562Generator.ClassDeclaration("c", members: [Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"))]),
1566Generator.ClassDeclaration("c", members: [Generator.ConstructorDeclaration()]),
1574Generator.StructDeclaration("s"),
1578Generator.StructDeclaration("s", typeParameters: ["x", "y"]),
1582Generator.StructDeclaration("s", interfaceTypes: [Generator.IdentifierName("x")]),
1586Generator.StructDeclaration("s", interfaceTypes: [Generator.IdentifierName("x"), Generator.IdentifierName("y")]),
1590Generator.StructDeclaration("s", interfaceTypes: new SyntaxNode[] { }),
1594Generator.StructDeclaration("s", members: [Generator.FieldDeclaration("y", Generator.IdentifierName("x"))]),
1598Generator.StructDeclaration("s", members: [Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"))]),
1602Generator.StructDeclaration("s", members: [Generator.ConstructorDeclaration("xxx")]),
1610Generator.InterfaceDeclaration("i"),
1614Generator.InterfaceDeclaration("i", typeParameters: ["x", "y"]),
1618Generator.InterfaceDeclaration("i", interfaceTypes: [Generator.IdentifierName("a")]),
1622Generator.InterfaceDeclaration("i", interfaceTypes: [Generator.IdentifierName("a"), Generator.IdentifierName("b")]),
1626Generator.InterfaceDeclaration("i", interfaceTypes: new SyntaxNode[] { }),
1630Generator.InterfaceDeclaration("i", members: [Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Sealed)]),
1634Generator.InterfaceDeclaration("i", members: [Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Sealed)]),
1638Generator.InterfaceDeclaration("i", members: [Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.ReadOnly)]),
1642Generator.InterfaceDeclaration("i", members: [Generator.IndexerDeclaration([Generator.ParameterDeclaration("y", Generator.IdentifierName("x"))], Generator.IdentifierName("t"), Accessibility.Public, DeclarationModifiers.Sealed)]),
1646Generator.InterfaceDeclaration("i", members: [Generator.IndexerDeclaration([Generator.ParameterDeclaration("y", Generator.IdentifierName("x"))], Generator.IdentifierName("t"), Accessibility.Public, DeclarationModifiers.ReadOnly)]),
1650Generator.InterfaceDeclaration("i", members: [Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Static)]),
1654Generator.InterfaceDeclaration("i", members: [Generator.EventDeclaration("ef", Generator.IdentifierName("t"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Static)]),
1658Generator.InterfaceDeclaration("i", members: [Generator.FieldDeclaration("f", Generator.IdentifierName("t"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Sealed)]),
1672Generator.Declaration(symbol),
1680Generator.EnumDeclaration("e"),
1684Generator.EnumDeclaration("e", members: [Generator.EnumMember("a"), Generator.EnumMember("b"), Generator.EnumMember("c")]),
1688Generator.EnumDeclaration("e", members: [Generator.IdentifierName("a"), Generator.EnumMember("b"), Generator.IdentifierName("c")]),
1692Generator.EnumDeclaration("e", members: [Generator.EnumMember("a", Generator.LiteralExpression(0)), Generator.EnumMember("b"), Generator.EnumMember("c", Generator.LiteralExpression(5))]),
1696Generator.EnumDeclaration("e", members: [Generator.FieldDeclaration("a", Generator.IdentifierName("e"), initializer: Generator.LiteralExpression(1))]),
1704Generator.DelegateDeclaration("d"),
1708Generator.DelegateDeclaration("d", returnType: Generator.IdentifierName("t")),
1712Generator.DelegateDeclaration("d", returnType: Generator.IdentifierName("t"), parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("pt"))]),
1716Generator.DelegateDeclaration("d", accessibility: Accessibility.Public),
1720Generator.DelegateDeclaration("d", accessibility: Accessibility.Public),
1724Generator.DelegateDeclaration("d", modifiers: DeclarationModifiers.New),
1728Generator.DelegateDeclaration("d", typeParameters: ["T", "S"]),
1736Generator.NamespaceImportDeclaration(Generator.IdentifierName("n")),
1740Generator.NamespaceImportDeclaration("n"),
1744Generator.NamespaceImportDeclaration("n.m"),
1752Generator.NamespaceDeclaration("n"),
1756Generator.NamespaceDeclaration("n.m"),
1760Generator.NamespaceDeclaration("n",
1761Generator.NamespaceImportDeclaration("m")),
1765Generator.NamespaceDeclaration("n",
1766Generator.ClassDeclaration("c"),
1767Generator.NamespaceImportDeclaration("m")),
1775Generator.CompilationUnit(),
1779Generator.CompilationUnit(
1780Generator.NamespaceDeclaration("n")),
1784Generator.CompilationUnit(
1785Generator.NamespaceImportDeclaration("n")),
1789Generator.CompilationUnit(
1790Generator.ClassDeclaration("c"),
1791Generator.NamespaceImportDeclaration("m")),
1795Generator.CompilationUnit(
1796Generator.NamespaceImportDeclaration("n"),
1797Generator.NamespaceDeclaration("n",
1798Generator.NamespaceImportDeclaration("m"),
1799Generator.ClassDeclaration("c"))),
1807Generator.Attribute(Generator.IdentifierName("a")),
1811Generator.Attribute("a"),
1815Generator.Attribute("a.b"),
1819Generator.Attribute("a", []),
1823Generator.Attribute("a", [Generator.IdentifierName("x")]),
1827Generator.Attribute("a", [Generator.AttributeArgument(Generator.IdentifierName("x"))]),
1831Generator.Attribute("a", [Generator.AttributeArgument("x", Generator.IdentifierName("y"))]),
1835Generator.Attribute("a", [Generator.IdentifierName("x"), Generator.IdentifierName("y")]),
1843Generator.AddAttributes(
1844Generator.FieldDeclaration("y", Generator.IdentifierName("x")),
1845Generator.Attribute("a")),
1849Generator.AddAttributes(
1850Generator.AddAttributes(
1851Generator.FieldDeclaration("y", Generator.IdentifierName("x")),
1852Generator.Attribute("a")),
1853Generator.Attribute("b")),
1857Generator.AddAttributes(
1858Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"), modifiers: DeclarationModifiers.Abstract),
1859Generator.Attribute("a")),
1863Generator.AddReturnAttributes(
1864Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"), modifiers: DeclarationModifiers.Abstract),
1865Generator.Attribute("a")),
1869Generator.AddAttributes(
1870Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), accessibility: Accessibility.NotApplicable, modifiers: DeclarationModifiers.Abstract),
1871Generator.Attribute("a")),
1875Generator.AddAttributes(
1876Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.Abstract),
1877Generator.Attribute("a")),
1881Generator.AddAttributes(
1882Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"), modifiers: DeclarationModifiers.Abstract),
1883Generator.Attribute("a")),
1887Generator.AddAttributes(
1888Generator.EventDeclaration("ef", Generator.IdentifierName("t")),
1889Generator.Attribute("a")),
1893Generator.AddAttributes(
1894Generator.ClassDeclaration("c"),
1895Generator.Attribute("a")),
1899Generator.AddAttributes(
1900Generator.StructDeclaration("s"),
1901Generator.Attribute("a")),
1905Generator.AddAttributes(
1906Generator.InterfaceDeclaration("i"),
1907Generator.Attribute("a")),
1911Generator.AddAttributes(
1912Generator.DelegateDeclaration("d"),
1913Generator.Attribute("a")),
1917Generator.AddAttributes(
1918Generator.ParameterDeclaration("p", Generator.IdentifierName("t")),
1919Generator.Attribute("a")),
1923Generator.AddAttributes(
1924Generator.CompilationUnit(Generator.NamespaceDeclaration("n")),
1925Generator.Attribute("a")),
1929Generator.AddAttributes(
1930Generator.AddAttributes(
1931Generator.CompilationUnit(Generator.NamespaceDeclaration("n")),
1932Generator.Attribute("a")),
1933Generator.Attribute("b")),
1937Generator.AddAttributes(
1939Generator.Attribute("a")),
1943Generator.AddAttributes(
1945Generator.Attribute("a")),
1949Generator.AddAttributes(
1951Generator.Attribute("a")),
1958var prop = Generator.PropertyDeclaration("P", Generator.IdentifierName("T"));
1959var evnt = Generator.CustomEventDeclaration("E", Generator.IdentifierName("T"));
1960CheckAddRemoveAttribute(Generator.GetAccessor(prop, DeclarationKind.GetAccessor));
1961CheckAddRemoveAttribute(Generator.GetAccessor(prop, DeclarationKind.SetAccessor));
1962CheckAddRemoveAttribute(Generator.GetAccessor(evnt, DeclarationKind.AddAccessor));
1963CheckAddRemoveAttribute(Generator.GetAccessor(evnt, DeclarationKind.RemoveAccessor));
1968var initialAttributes = Generator.GetAttributes(declaration);
1971var withAttribute = Generator.AddAttributes(declaration, Generator.Attribute("a"));
1972var attrsAdded = Generator.GetAttributes(withAttribute);
1975var withoutAttribute = Generator.RemoveNode(withAttribute, attrsAdded[0]);
1976var attrsRemoved = Generator.GetAttributes(withoutAttribute);
1986var added = Generator.AddAttributes(cls, Generator.Attribute("a"));
1989var removed = Generator.RemoveAllAttributes(added);
1992var attrWithComment = Generator.GetAttributes(added).First();
2000Generator.WithTypeParameters(
2001Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Abstract),
2006Generator.WithTypeParameters(
2007Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Abstract)),
2011Generator.WithTypeParameters(
2012Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Abstract),
2017Generator.WithTypeParameters(Generator.WithTypeParameters(
2018Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Abstract),
2023Generator.WithTypeParameters(
2024Generator.ClassDeclaration("c"),
2029Generator.WithTypeParameters(
2030Generator.StructDeclaration("s"),
2035Generator.WithTypeParameters(
2036Generator.InterfaceDeclaration("i"),
2041Generator.WithTypeParameters(
2042Generator.DelegateDeclaration("d"),
2051Generator.WithTypeConstraint(
2052Generator.WithTypeParameters(Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Abstract), "a"),
2053"a", Generator.IdentifierName("b")),
2057Generator.WithTypeConstraint(
2058Generator.WithTypeParameters(Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Abstract), "a"),
2059"a", Generator.IdentifierName("b"), Generator.IdentifierName("c")),
2063Generator.WithTypeConstraint(
2064Generator.WithTypeParameters(Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Abstract), "a"),
2069Generator.WithTypeConstraint(Generator.WithTypeConstraint(
2070Generator.WithTypeParameters(Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Abstract), "a"),
2071"a", Generator.IdentifierName("b"), Generator.IdentifierName("c")), "a"),
2075Generator.WithTypeConstraint(
2076Generator.WithTypeConstraint(
2077Generator.WithTypeParameters(Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Abstract), "a", "x"),
2078"a", Generator.IdentifierName("b"), Generator.IdentifierName("c")),
2079"x", Generator.IdentifierName("y")),
2083Generator.WithTypeConstraint(
2084Generator.WithTypeParameters(Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Abstract), "a"),
2089Generator.WithTypeConstraint(
2090Generator.WithTypeParameters(Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Abstract), "a"),
2095Generator.WithTypeConstraint(
2096Generator.WithTypeParameters(Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Abstract), "a"),
2101Generator.WithTypeConstraint(
2102Generator.WithTypeParameters(Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Abstract), "a"),
2107Generator.WithTypeConstraint(
2108Generator.WithTypeParameters(Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Abstract), "a"),
2113Generator.WithTypeConstraint(
2114Generator.WithTypeParameters(Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Abstract), "a"),
2115"a", SpecialTypeConstraintKind.ReferenceType, Generator.IdentifierName("b"), Generator.IdentifierName("c")),
2120Generator.WithTypeConstraint(
2121Generator.WithTypeParameters(
2122Generator.ClassDeclaration("c"),
2124"a", Generator.IdentifierName("x")),
2128Generator.WithTypeConstraint(
2129Generator.WithTypeParameters(
2130Generator.StructDeclaration("s"),
2132"a", Generator.IdentifierName("x")),
2136Generator.WithTypeConstraint(
2137Generator.WithTypeParameters(
2138Generator.InterfaceDeclaration("i"),
2140"a", Generator.IdentifierName("x")),
2144Generator.WithTypeConstraint(
2145Generator.WithTypeParameters(
2146Generator.DelegateDeclaration("d"),
2148"a", Generator.IdentifierName("x")),
2156Generator.Declaration(_emptyCompilation.GetTypeByMetadataName("System.ComponentModel.INotifyPropertyChanged")),
2167Generator.Declaration(
2178Generator.Declaration(
2192Generator.Declaration(
2211VerifySyntax<DelegateDeclarationSyntax>(Generator.Declaration(type), """
2230Generator.Declaration(method), """
2251Generator.Declaration(method), """
2272Generator.Declaration(method), """
2293Generator.Declaration(method), """
2314Generator.Declaration(method),
2336Generator.Declaration(property),
2354Generator.Declaration(property),
2377Generator.Declaration(property),
2405Generator.Declaration(property),
2433Generator.Declaration(property),
2464Generator.Declaration(property),
2501Generator.Declaration(method),
2508Generator.Declaration(property),
2511Generator.Declaration(indexer),
2521Generator.Declaration(ev),
2541Generator.Declaration(field),
2564Generator.Declaration(field),
2574Generator.Declaration(field),
2594Generator.Declaration(method), """
2607var actualNames = actualNodes.Select(n => Generator.GetName(n)).ToArray();
2617=> AssertNamesEqual(expectedNames, Generator.GetMembers(declaration));
2620=> AssertNamesEqual(new[] { expectedName }, Generator.GetMembers(declaration));
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"]);
2643=> Assert.Equal(0, Generator.GetNamespaceImports(Generator.RemoveNodes(declaration, Generator.GetNamespaceImports(declaration))).Count);
2647var newDecl = Generator.RemoveNode(declaration, Generator.GetNamespaceImports(declaration).First(m => Generator.GetName(m) == name));
2648AssertNamesEqual(remainingNames, Generator.GetNamespaceImports(newDecl));
2664var newCu = Generator.RemoveNode(cu, summary);
2690var newCu = Generator.ReplaceNode(cu, summary, summary2);
2713var newCu = Generator.InsertNodesAfter(cu, text, [text]);
2736var newCu = Generator.InsertNodesBefore(cu, text, [text]);
2749AssertMemberNamesEqual("m", Generator.AddMembers(Generator.ClassDeclaration("d"), [Generator.MethodDeclaration("m")]));
2750AssertMemberNamesEqual("m", Generator.AddMembers(Generator.StructDeclaration("s"), [Generator.MethodDeclaration("m")]));
2751AssertMemberNamesEqual("m", Generator.AddMembers(Generator.InterfaceDeclaration("i"), [Generator.MethodDeclaration("m")]));
2752AssertMemberNamesEqual("", Generator.AddMembers(Generator.InterfaceDeclaration("i"), [Generator.OperatorDeclaration(OperatorKind.Addition)]));
2753AssertMemberNamesEqual("v", Generator.AddMembers(Generator.EnumDeclaration("e"), [Generator.EnumMember("v")]));
2754AssertMemberNamesEqual("n2", Generator.AddMembers(Generator.NamespaceDeclaration("n"), [Generator.NamespaceDeclaration("n2")]));
2755AssertMemberNamesEqual("n", Generator.AddMembers(Generator.CompilationUnit(), [Generator.NamespaceDeclaration("n")]));
2757AssertMemberNamesEqual(new[] { "m", "m2" }, Generator.AddMembers(Generator.ClassDeclaration("d", members: [Generator.MethodDeclaration("m")]), [Generator.MethodDeclaration("m2")]));
2758AssertMemberNamesEqual(new[] { "m", "m2" }, Generator.AddMembers(Generator.StructDeclaration("s", members: [Generator.MethodDeclaration("m")]), [Generator.MethodDeclaration("m2")]));
2759AssertMemberNamesEqual(new[] { "m", "m2" }, Generator.AddMembers(Generator.InterfaceDeclaration("i", members: [Generator.MethodDeclaration("m")]), [Generator.MethodDeclaration("m2")]));
2760AssertMemberNamesEqual(new[] { "v", "v2" }, Generator.AddMembers(Generator.EnumDeclaration("i", members: [Generator.EnumMember("v")]), [Generator.EnumMember("v2")]));
2761AssertMemberNamesEqual(new[] { "n1", "n2" }, Generator.AddMembers(Generator.NamespaceDeclaration("n", [Generator.NamespaceDeclaration("n1")]), [Generator.NamespaceDeclaration("n2")]));
2762AssertMemberNamesEqual(new[] { "n1", "n2" }, Generator.AddMembers(Generator.CompilationUnit(declarations: [Generator.NamespaceDeclaration("n1")]), [Generator.NamespaceDeclaration("n2")]));
2768VerifySyntax<InterfaceDeclarationSyntax>(Generator.AddMembers(Generator.InterfaceDeclaration("i"),
2769[Generator.OperatorDeclaration(OperatorKind.Addition)]),
2777VerifySyntax<InterfaceDeclarationSyntax>(Generator.AddMembers(Generator.InterfaceDeclaration("i"),
2778[Generator.OperatorDeclaration(OperatorKind.Addition, modifiers: DeclarationModifiers.Abstract)]),
2786VerifySyntax<InterfaceDeclarationSyntax>(Generator.AddMembers(Generator.InterfaceDeclaration("i"),
2787[Generator.OperatorDeclaration(OperatorKind.Addition, modifiers: DeclarationModifiers.Virtual)]),
2799var method = (MethodDeclarationSyntax)Generator.MethodDeclaration("m");
2801method = method.WithExpressionBody(ArrowExpressionClause((ExpressionSyntax)Generator.IdentifierName("x")));
2803VerifySyntax<InterfaceDeclarationSyntax>(Generator.AddMembers(Generator.InterfaceDeclaration("i"),
2812var getAccessor = (AccessorDeclarationSyntax)Generator.GetAccessorDeclaration();
2814getAccessor = getAccessor.WithExpressionBody(ArrowExpressionClause((ExpressionSyntax)Generator.IdentifierName("x")));
2816var setAccessor = (AccessorDeclarationSyntax)Generator.SetAccessorDeclaration();
2818setAccessor = setAccessor.WithExpressionBody(ArrowExpressionClause((ExpressionSyntax)Generator.InvocationExpression(Generator.IdentifierName("x"))));
2821Generator.WithAccessorDeclarations(
2822Generator.PropertyDeclaration("p", Generator.IdentifierName("x")),
2825VerifySyntax<InterfaceDeclarationSyntax>(Generator.AddMembers(Generator.InterfaceDeclaration("i"),
2839TestRemoveAllMembers(Generator.ClassDeclaration("c", members: [Generator.MethodDeclaration("m")]));
2840TestRemoveAllMembers(Generator.StructDeclaration("s", members: [Generator.MethodDeclaration("m")]));
2841TestRemoveAllMembers(Generator.InterfaceDeclaration("i", members: [Generator.MethodDeclaration("m")]));
2842TestRemoveAllMembers(Generator.EnumDeclaration("i", members: [Generator.EnumMember("v")]));
2843TestRemoveAllMembers(Generator.NamespaceDeclaration("n", [Generator.NamespaceDeclaration("n")]));
2844TestRemoveAllMembers(Generator.CompilationUnit(declarations: [Generator.NamespaceDeclaration("n")]));
2846TestRemoveMember(Generator.ClassDeclaration("c", members: [Generator.MethodDeclaration("m1"), Generator.MethodDeclaration("m2")]), "m1", ["m2"]);
2847TestRemoveMember(Generator.StructDeclaration("s", members: [Generator.MethodDeclaration("m1"), Generator.MethodDeclaration("m2")]), "m1", ["m2"]);
2851=> Assert.Equal(0, Generator.GetMembers(Generator.RemoveNodes(declaration, Generator.GetMembers(declaration))).Count);
2855var newDecl = Generator.RemoveNode(declaration, Generator.GetMembers(declaration).First(m => Generator.GetName(m) == name));
2862AssertMemberNamesEqual("m", Generator.ClassDeclaration("c", members: [Generator.MethodDeclaration("m")]));
2863AssertMemberNamesEqual("m", Generator.StructDeclaration("s", members: [Generator.MethodDeclaration("m")]));
2864AssertMemberNamesEqual("m", Generator.InterfaceDeclaration("i", members: [Generator.MethodDeclaration("m")]));
2865AssertMemberNamesEqual("v", Generator.EnumDeclaration("e", members: [Generator.EnumMember("v")]));
2866AssertMemberNamesEqual("c", Generator.NamespaceDeclaration("n", declarations: [Generator.ClassDeclaration("c")]));
2867AssertMemberNamesEqual("c", Generator.CompilationUnit(declarations: [Generator.ClassDeclaration("c")]));
2873Assert.Equal(DeclarationKind.CompilationUnit, Generator.GetDeclarationKind(Generator.CompilationUnit()));
2874Assert.Equal(DeclarationKind.Class, Generator.GetDeclarationKind(Generator.ClassDeclaration("c")));
2875Assert.Equal(DeclarationKind.Struct, Generator.GetDeclarationKind(Generator.StructDeclaration("s")));
2876Assert.Equal(DeclarationKind.Interface, Generator.GetDeclarationKind(Generator.InterfaceDeclaration("i")));
2877Assert.Equal(DeclarationKind.Enum, Generator.GetDeclarationKind(Generator.EnumDeclaration("e")));
2878Assert.Equal(DeclarationKind.Delegate, Generator.GetDeclarationKind(Generator.DelegateDeclaration("d")));
2879Assert.Equal(DeclarationKind.Method, Generator.GetDeclarationKind(Generator.MethodDeclaration("m")));
2880Assert.Equal(DeclarationKind.Constructor, Generator.GetDeclarationKind(Generator.ConstructorDeclaration()));
2881Assert.Equal(DeclarationKind.Parameter, Generator.GetDeclarationKind(Generator.ParameterDeclaration("p")));
2882Assert.Equal(DeclarationKind.Property, Generator.GetDeclarationKind(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))));
2883Assert.Equal(DeclarationKind.Indexer, Generator.GetDeclarationKind(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t"))));
2884Assert.Equal(DeclarationKind.Field, Generator.GetDeclarationKind(Generator.FieldDeclaration("f", Generator.IdentifierName("t"))));
2885Assert.Equal(DeclarationKind.EnumMember, Generator.GetDeclarationKind(Generator.EnumMember("v")));
2886Assert.Equal(DeclarationKind.Event, Generator.GetDeclarationKind(Generator.EventDeclaration("ef", Generator.IdentifierName("t"))));
2887Assert.Equal(DeclarationKind.CustomEvent, Generator.GetDeclarationKind(Generator.CustomEventDeclaration("e", Generator.IdentifierName("t"))));
2888Assert.Equal(DeclarationKind.Namespace, Generator.GetDeclarationKind(Generator.NamespaceDeclaration("n")));
2889Assert.Equal(DeclarationKind.NamespaceImport, Generator.GetDeclarationKind(Generator.NamespaceImportDeclaration("u")));
2890Assert.Equal(DeclarationKind.Variable, Generator.GetDeclarationKind(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc")));
2891Assert.Equal(DeclarationKind.Attribute, Generator.GetDeclarationKind(Generator.Attribute("a")));
2897Assert.Equal("c", Generator.GetName(Generator.ClassDeclaration("c")));
2898Assert.Equal("s", Generator.GetName(Generator.StructDeclaration("s")));
2899Assert.Equal("i", Generator.GetName(Generator.EnumDeclaration("i")));
2900Assert.Equal("e", Generator.GetName(Generator.EnumDeclaration("e")));
2901Assert.Equal("d", Generator.GetName(Generator.DelegateDeclaration("d")));
2902Assert.Equal("m", Generator.GetName(Generator.MethodDeclaration("m")));
2903Assert.Equal("", Generator.GetName(Generator.ConstructorDeclaration()));
2904Assert.Equal("p", Generator.GetName(Generator.ParameterDeclaration("p")));
2905Assert.Equal("p", Generator.GetName(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))));
2906Assert.Equal("", Generator.GetName(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t"))));
2907Assert.Equal("f", Generator.GetName(Generator.FieldDeclaration("f", Generator.IdentifierName("t"))));
2908Assert.Equal("v", Generator.GetName(Generator.EnumMember("v")));
2909Assert.Equal("ef", Generator.GetName(Generator.EventDeclaration("ef", Generator.IdentifierName("t"))));
2910Assert.Equal("ep", Generator.GetName(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"))));
2911Assert.Equal("n", Generator.GetName(Generator.NamespaceDeclaration("n")));
2912Assert.Equal("u", Generator.GetName(Generator.NamespaceImportDeclaration("u")));
2913Assert.Equal("loc", Generator.GetName(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc")));
2914Assert.Equal("a", Generator.GetName(Generator.Attribute("a")));
2920Assert.Equal("c", Generator.GetName(Generator.WithName(Generator.ClassDeclaration("x"), "c")));
2921Assert.Equal("s", Generator.GetName(Generator.WithName(Generator.StructDeclaration("x"), "s")));
2922Assert.Equal("i", Generator.GetName(Generator.WithName(Generator.EnumDeclaration("x"), "i")));
2923Assert.Equal("e", Generator.GetName(Generator.WithName(Generator.EnumDeclaration("x"), "e")));
2924Assert.Equal("d", Generator.GetName(Generator.WithName(Generator.DelegateDeclaration("x"), "d")));
2925Assert.Equal("m", Generator.GetName(Generator.WithName(Generator.MethodDeclaration("x"), "m")));
2926Assert.Equal("", Generator.GetName(Generator.WithName(Generator.ConstructorDeclaration(), ".ctor")));
2927Assert.Equal("p", Generator.GetName(Generator.WithName(Generator.ParameterDeclaration("x"), "p")));
2928Assert.Equal("p", Generator.GetName(Generator.WithName(Generator.PropertyDeclaration("x", Generator.IdentifierName("t")), "p")));
2929Assert.Equal("", Generator.GetName(Generator.WithName(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t")), "this")));
2930Assert.Equal("f", Generator.GetName(Generator.WithName(Generator.FieldDeclaration("x", Generator.IdentifierName("t")), "f")));
2931Assert.Equal("v", Generator.GetName(Generator.WithName(Generator.EnumMember("x"), "v")));
2932Assert.Equal("ef", Generator.GetName(Generator.WithName(Generator.EventDeclaration("x", Generator.IdentifierName("t")), "ef")));
2933Assert.Equal("ep", Generator.GetName(Generator.WithName(Generator.CustomEventDeclaration("x", Generator.IdentifierName("t")), "ep")));
2934Assert.Equal("n", Generator.GetName(Generator.WithName(Generator.NamespaceDeclaration("x"), "n")));
2935Assert.Equal("u", Generator.GetName(Generator.WithName(Generator.NamespaceImportDeclaration("x"), "u")));
2936Assert.Equal("loc", Generator.GetName(Generator.WithName(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "x"), "loc")));
2937Assert.Equal("a", Generator.GetName(Generator.WithName(Generator.Attribute("x"), "a")));
2943Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.ClassDeclaration("c", accessibility: Accessibility.Internal)));
2944Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.StructDeclaration("s", accessibility: Accessibility.Internal)));
2945Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.EnumDeclaration("i", accessibility: Accessibility.Internal)));
2946Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.EnumDeclaration("e", accessibility: Accessibility.Internal)));
2947Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.DelegateDeclaration("d", accessibility: Accessibility.Internal)));
2948Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.MethodDeclaration("m", accessibility: Accessibility.Internal)));
2949Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.ConstructorDeclaration(accessibility: Accessibility.Internal)));
2950Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.ParameterDeclaration("p")));
2951Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility: Accessibility.Internal)));
2952Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t"), accessibility: Accessibility.Internal)));
2953Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.FieldDeclaration("f", Generator.IdentifierName("t"), accessibility: Accessibility.Internal)));
2954Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.EnumMember("v")));
2955Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.EventDeclaration("ef", Generator.IdentifierName("t"), accessibility: Accessibility.Internal)));
2956Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"), accessibility: Accessibility.Internal)));
2957Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.NamespaceDeclaration("n")));
2958Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.NamespaceImportDeclaration("u")));
2959Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc")));
2960Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.Attribute("a")));
2961Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(TypeParameter("tp")));
2967Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.ClassDeclaration("c", accessibility: Accessibility.Internal), Accessibility.Private)));
2968Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.StructDeclaration("s", accessibility: Accessibility.Internal), Accessibility.Private)));
2969Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.EnumDeclaration("i", accessibility: Accessibility.Internal), Accessibility.Private)));
2970Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.EnumDeclaration("e", accessibility: Accessibility.Internal), Accessibility.Private)));
2971Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.DelegateDeclaration("d", accessibility: Accessibility.Internal), Accessibility.Private)));
2972Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.MethodDeclaration("m", accessibility: Accessibility.Internal), Accessibility.Private)));
2973Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.ConstructorDeclaration(accessibility: Accessibility.Internal), Accessibility.Private)));
2974Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.ParameterDeclaration("p"), Accessibility.Private)));
2975Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility: Accessibility.Internal), Accessibility.Private)));
2976Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t"), accessibility: Accessibility.Internal), Accessibility.Private)));
2977Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.FieldDeclaration("f", Generator.IdentifierName("t"), accessibility: Accessibility.Internal), Accessibility.Private)));
2978Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.EnumMember("v"), Accessibility.Private)));
2979Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.EventDeclaration("ef", Generator.IdentifierName("t"), accessibility: Accessibility.Internal), Accessibility.Private)));
2980Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"), accessibility: Accessibility.Internal), Accessibility.Private)));
2981Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.NamespaceDeclaration("n"), Accessibility.Private)));
2982Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.NamespaceImportDeclaration("u"), Accessibility.Private)));
2983Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc"), Accessibility.Private)));
2984Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.Attribute("a"), Accessibility.Private)));
2985Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(TypeParameter("tp"), Accessibility.Private)));
2986Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(AccessorDeclaration(SyntaxKind.InitAccessorDeclaration), Accessibility.Private)));
2992Assert.Equal(DeclarationModifiers.Abstract, Generator.GetModifiers(Generator.ClassDeclaration("c", modifiers: DeclarationModifiers.Abstract)));
2993Assert.Equal(DeclarationModifiers.Partial, Generator.GetModifiers(Generator.StructDeclaration("s", modifiers: DeclarationModifiers.Partial)));
2994Assert.Equal(DeclarationModifiers.New, Generator.GetModifiers(Generator.EnumDeclaration("e", modifiers: DeclarationModifiers.New)));
2995Assert.Equal(DeclarationModifiers.New, Generator.GetModifiers(Generator.DelegateDeclaration("d", modifiers: DeclarationModifiers.New)));
2996Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.MethodDeclaration("m", modifiers: DeclarationModifiers.Static)));
2997Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.ConstructorDeclaration(modifiers: DeclarationModifiers.Static)));
2998Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.ParameterDeclaration("p")));
2999Assert.Equal(DeclarationModifiers.Abstract, Generator.GetModifiers(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), modifiers: DeclarationModifiers.Abstract)));
3000Assert.Equal(DeclarationModifiers.Abstract, Generator.GetModifiers(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t"), modifiers: DeclarationModifiers.Abstract)));
3001Assert.Equal(DeclarationModifiers.Const, Generator.GetModifiers(Generator.FieldDeclaration("f", Generator.IdentifierName("t"), modifiers: DeclarationModifiers.Const)));
3002Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.EventDeclaration("ef", Generator.IdentifierName("t"), modifiers: DeclarationModifiers.Static)));
3003Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"), modifiers: DeclarationModifiers.Static)));
3004Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.EnumMember("v")));
3005Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.NamespaceDeclaration("n")));
3006Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.NamespaceImportDeclaration("u")));
3007Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc")));
3008Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.Attribute("a")));
3009Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(TypeParameter("tp")));
3015Assert.Equal(DeclarationModifiers.Abstract, Generator.GetModifiers(Generator.WithModifiers(Generator.ClassDeclaration("c"), DeclarationModifiers.Abstract)));
3016Assert.Equal(DeclarationModifiers.Partial, Generator.GetModifiers(Generator.WithModifiers(Generator.StructDeclaration("s"), DeclarationModifiers.Partial)));
3017Assert.Equal(DeclarationModifiers.New, Generator.GetModifiers(Generator.WithModifiers(Generator.EnumDeclaration("e"), DeclarationModifiers.New)));
3018Assert.Equal(DeclarationModifiers.New, Generator.GetModifiers(Generator.WithModifiers(Generator.DelegateDeclaration("d"), DeclarationModifiers.New)));
3019Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.WithModifiers(Generator.MethodDeclaration("m"), DeclarationModifiers.Static)));
3020Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.WithModifiers(Generator.ConstructorDeclaration(), DeclarationModifiers.Static)));
3021Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.WithModifiers(Generator.ParameterDeclaration("p"), DeclarationModifiers.Abstract)));
3022Assert.Equal(DeclarationModifiers.Abstract, Generator.GetModifiers(Generator.WithModifiers(Generator.PropertyDeclaration("p", Generator.IdentifierName("t")), DeclarationModifiers.Abstract)));
3023Assert.Equal(DeclarationModifiers.Abstract, Generator.GetModifiers(Generator.WithModifiers(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t")), DeclarationModifiers.Abstract)));
3024Assert.Equal(DeclarationModifiers.Const, Generator.GetModifiers(Generator.WithModifiers(Generator.FieldDeclaration("f", Generator.IdentifierName("t")), DeclarationModifiers.Const)));
3025Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.WithModifiers(Generator.EventDeclaration("ef", Generator.IdentifierName("t")), DeclarationModifiers.Static)));
3026Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.WithModifiers(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t")), DeclarationModifiers.Static)));
3027Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.WithModifiers(Generator.EnumMember("v"), DeclarationModifiers.Partial)));
3028Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.WithModifiers(Generator.NamespaceDeclaration("n"), DeclarationModifiers.Abstract)));
3029Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.WithModifiers(Generator.NamespaceImportDeclaration("u"), DeclarationModifiers.Abstract)));
3030Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.WithModifiers(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc"), DeclarationModifiers.Abstract)));
3031Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.WithModifiers(Generator.Attribute("a"), DeclarationModifiers.Abstract)));
3032Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.WithModifiers(TypeParameter("tp"), DeclarationModifiers.Abstract)));
3042Generator.GetModifiers(Generator.WithModifiers(Generator.ClassDeclaration("c"), allModifiers)));
3046Generator.GetModifiers(Generator.WithModifiers(Generator.StructDeclaration("s"), allModifiers)));
3050Generator.GetModifiers(Generator.WithModifiers(Generator.InterfaceDeclaration("i"), allModifiers)));
3054Generator.GetModifiers(Generator.WithModifiers(Generator.DelegateDeclaration("d"), allModifiers)));
3058Generator.GetModifiers(Generator.WithModifiers(Generator.EnumDeclaration("e"), allModifiers)));
3062Generator.GetModifiers(Generator.WithModifiers(Generator.FieldDeclaration("f", Generator.IdentifierName("t")), allModifiers)));
3066Generator.GetModifiers(Generator.WithModifiers(Generator.ConstructorDeclaration("c"), allModifiers)));
3070Generator.GetModifiers(Generator.WithModifiers(DestructorDeclaration("c"), allModifiers)));
3074Generator.GetModifiers(Generator.WithModifiers(Generator.MethodDeclaration("m"), allModifiers)));
3078Generator.GetModifiers(Generator.WithModifiers(Generator.PropertyDeclaration("p", Generator.IdentifierName("t")), allModifiers)));
3082Generator.GetModifiers(Generator.WithModifiers(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t")), allModifiers)));
3086Generator.GetModifiers(Generator.WithModifiers(Generator.EventDeclaration("ef", Generator.IdentifierName("t")), allModifiers)));
3090Generator.GetModifiers(Generator.WithModifiers(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t")), allModifiers)));
3094Generator.GetModifiers(Generator.WithModifiers(AccessorDeclaration(SyntaxKind.GetAccessorDeclaration), allModifiers)));
3100var ctor = Generator.ConstructorDeclaration("C", modifiers: DeclarationModifiers.Static);
3105var publicCtor = Generator.WithAccessibility(ctor, Accessibility.Public);
3114var ctor = Generator.ConstructorDeclaration("C", accessibility: Accessibility.Public);
3119var staticCtor = Generator.WithModifiers(ctor, DeclarationModifiers.Static);
3129var fileAbstractClass = Generator.WithModifiers(fileClass, Generator.GetModifiers(fileClass).WithIsAbstract(true));
3139var filePublicClass = Generator.WithAccessibility(fileClass, Accessibility.Public);
3149var fileAbstractClass = Generator.WithModifiers(abstractClass, Generator.GetModifiers(abstractClass).WithIsFile(true));
3159var filePublicClass = Generator.WithModifiers(publicClass, Generator.GetModifiers(publicClass).WithIsFile(true));
3169var updatedProperty = Generator.WithModifiers(property, Generator.GetModifiers(property).WithIsRequired(true));
3177var updatedProperty = Generator.WithModifiers(property, Generator.GetModifiers(property).WithIsVirtual(true));
3187var updatedProperty = Generator.WithModifiers(property, Generator.GetModifiers(property).WithIsRequired(true));
3194Assert.Equal("t", Generator.GetType(Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"))).ToString());
3195Assert.Null(Generator.GetType(Generator.MethodDeclaration("m")));
3197Assert.Equal("t", Generator.GetType(Generator.FieldDeclaration("f", Generator.IdentifierName("t"))).ToString());
3198Assert.Equal("t", Generator.GetType(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))).ToString());
3199Assert.Equal("t", Generator.GetType(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("pt"))], Generator.IdentifierName("t"))).ToString());
3200Assert.Equal("t", Generator.GetType(Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))).ToString());
3202Assert.Equal("t", Generator.GetType(Generator.EventDeclaration("ef", Generator.IdentifierName("t"))).ToString());
3203Assert.Equal("t", Generator.GetType(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"))).ToString());
3205Assert.Equal("t", Generator.GetType(Generator.DelegateDeclaration("t", returnType: Generator.IdentifierName("t"))).ToString());
3206Assert.Null(Generator.GetType(Generator.DelegateDeclaration("d")));
3208Assert.Equal("t", Generator.GetType(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "v")).ToString());
3210Assert.Null(Generator.GetType(Generator.ClassDeclaration("c")));
3211Assert.Null(Generator.GetType(Generator.IdentifierName("x")));
3217Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString());
3218Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.FieldDeclaration("f", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString());
3219Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.PropertyDeclaration("p", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString());
3220Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("pt"))], Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString());
3221Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.ParameterDeclaration("p", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString());
3223Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.DelegateDeclaration("t"), Generator.IdentifierName("t"))).ToString());
3225Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.EventDeclaration("ef", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString());
3226Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString());
3228Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.LocalDeclarationStatement(Generator.IdentifierName("x"), "v"), Generator.IdentifierName("t"))).ToString());
3229Assert.Null(Generator.GetType(Generator.WithType(Generator.ClassDeclaration("c"), Generator.IdentifierName("t"))));
3230Assert.Null(Generator.GetType(Generator.WithType(Generator.IdentifierName("x"), Generator.IdentifierName("t"))));
3236Assert.Equal(0, Generator.GetParameters(Generator.MethodDeclaration("m")).Count);
3237Assert.Equal(1, Generator.GetParameters(Generator.MethodDeclaration("m", parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3238Assert.Equal(2, Generator.GetParameters(Generator.MethodDeclaration("m", parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))])).Count);
3240Assert.Equal(0, Generator.GetParameters(Generator.ConstructorDeclaration()).Count);
3241Assert.Equal(1, Generator.GetParameters(Generator.ConstructorDeclaration(parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3242Assert.Equal(2, Generator.GetParameters(Generator.ConstructorDeclaration(parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))])).Count);
3244Assert.Equal(1, Generator.GetParameters(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))], Generator.IdentifierName("t"))).Count);
3245Assert.Equal(2, Generator.GetParameters(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))], Generator.IdentifierName("t"))).Count);
3247Assert.Equal(0, Generator.GetParameters(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("expr"))).Count);
3248Assert.Equal(1, Generator.GetParameters(Generator.ValueReturningLambdaExpression("p1", Generator.IdentifierName("expr"))).Count);
3250Assert.Equal(0, Generator.GetParameters(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("expr"))).Count);
3251Assert.Equal(1, Generator.GetParameters(Generator.VoidReturningLambdaExpression("p1", Generator.IdentifierName("expr"))).Count);
3253Assert.Equal(0, Generator.GetParameters(Generator.DelegateDeclaration("d")).Count);
3254Assert.Equal(1, Generator.GetParameters(Generator.DelegateDeclaration("d", parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3256Assert.Equal(0, Generator.GetParameters(Generator.ClassDeclaration("c")).Count);
3257Assert.Equal(0, Generator.GetParameters(Generator.IdentifierName("x")).Count);
3263Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.MethodDeclaration("m"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3264Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.ConstructorDeclaration(), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3265Assert.Equal(3, Generator.GetParameters(Generator.AddParameters(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))], Generator.IdentifierName("t")), [Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2")), Generator.ParameterDeclaration("p3", Generator.IdentifierName("t3"))])).Count);
3267Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("expr")), [Generator.LambdaParameter("p")])).Count);
3268Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("expr")), [Generator.LambdaParameter("p")])).Count);
3270Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.DelegateDeclaration("d"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3272Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.ClassDeclaration("c"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3273Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.StructDeclaration("c"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3274Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.InterfaceDeclaration("c"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3275Assert.Equal(0, Generator.GetParameters(Generator.AddParameters(Generator.IdentifierName("x"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3282Assert.Equal("x", Generator.GetExpression(Generator.FieldDeclaration("f", Generator.IdentifierName("t"), initializer: Generator.IdentifierName("x"))).ToString());
3283Assert.Equal("x", Generator.GetExpression(Generator.ParameterDeclaration("p", Generator.IdentifierName("t"), initializer: Generator.IdentifierName("x"))).ToString());
3284Assert.Equal("x", Generator.GetExpression(Generator.LocalDeclarationStatement("loc", initializer: Generator.IdentifierName("x"))).ToString());
3287Assert.Null(Generator.GetExpression(Generator.ValueReturningLambdaExpression("p", [Generator.IdentifierName("x")])));
3288Assert.Equal(1, Generator.GetStatements(Generator.ValueReturningLambdaExpression("p", [Generator.IdentifierName("x")])).Count);
3289Assert.Equal("x", Generator.GetExpression(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("x"))).ToString());
3290Assert.Equal("x", Generator.GetExpression(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("x"))).ToString());
3291Assert.Equal("x", Generator.GetExpression(Generator.ValueReturningLambdaExpression("p", Generator.IdentifierName("x"))).ToString());
3292Assert.Equal("x", Generator.GetExpression(Generator.VoidReturningLambdaExpression("p", Generator.IdentifierName("x"))).ToString());
3295Assert.Null(Generator.GetExpression(Generator.IdentifierName("e")));
3298var method = (MethodDeclarationSyntax)Generator.MethodDeclaration("p");
3300method = method.WithExpressionBody(ArrowExpressionClause((ExpressionSyntax)Generator.IdentifierName("x")));
3302Assert.Equal("x", Generator.GetExpression(method).ToString());
3307local = local.WithExpressionBody(ArrowExpressionClause((ExpressionSyntax)Generator.IdentifierName("x")));
3309Assert.Equal("x", Generator.GetExpression(local).ToString());
3316Assert.Equal("x", Generator.GetExpression(Generator.WithExpression(Generator.FieldDeclaration("f", Generator.IdentifierName("t")), Generator.IdentifierName("x"))).ToString());
3317Assert.Equal("x", Generator.GetExpression(Generator.WithExpression(Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.IdentifierName("x"))).ToString());
3318Assert.Equal("x", Generator.GetExpression(Generator.WithExpression(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc"), Generator.IdentifierName("x"))).ToString());
3321Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.ValueReturningLambdaExpression("p", [Generator.IdentifierName("x")]), Generator.IdentifierName("y"))).ToString());
3322Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.VoidReturningLambdaExpression("p", [Generator.IdentifierName("x")]), Generator.IdentifierName("y"))).ToString());
3323Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.ValueReturningLambdaExpression([Generator.IdentifierName("x")]), Generator.IdentifierName("y"))).ToString());
3324Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.VoidReturningLambdaExpression([Generator.IdentifierName("x")]), Generator.IdentifierName("y"))).ToString());
3325Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.ValueReturningLambdaExpression("p", Generator.IdentifierName("x")), Generator.IdentifierName("y"))).ToString());
3326Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.VoidReturningLambdaExpression("p", Generator.IdentifierName("x")), Generator.IdentifierName("y"))).ToString());
3327Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("x")), Generator.IdentifierName("y"))).ToString());
3328Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("x")), Generator.IdentifierName("y"))).ToString());
3331Assert.Null(Generator.GetExpression(Generator.WithExpression(Generator.IdentifierName("e"), Generator.IdentifierName("x"))));
3334var method = (MethodDeclarationSyntax)Generator.MethodDeclaration("p");
3336method = method.WithExpressionBody(ArrowExpressionClause((ExpressionSyntax)Generator.IdentifierName("x")));
3338Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(method, Generator.IdentifierName("y"))).ToString());
3343local = local.WithExpressionBody(ArrowExpressionClause((ExpressionSyntax)Generator.IdentifierName("x")));
3345Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(local, Generator.IdentifierName("y"))).ToString());
3351var prop = Generator.PropertyDeclaration("p", Generator.IdentifierName("T"));
3353Assert.Equal(2, Generator.GetAccessors(prop).Count);
3356var getAccessor = Generator.GetAccessor(prop, DeclarationKind.GetAccessor);
3362Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(getAccessor));
3365var setAccessor = Generator.GetAccessor(prop, DeclarationKind.SetAccessor);
3367Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(setAccessor));
3370Assert.Null(Generator.GetAccessor(Generator.RemoveNode(prop, getAccessor), DeclarationKind.GetAccessor));
3371Assert.Null(Generator.GetAccessor(Generator.RemoveNode(prop, setAccessor), DeclarationKind.SetAccessor));
3374Assert.Equal(Accessibility.Public, Generator.GetAccessibility(Generator.WithAccessibility(getAccessor, Accessibility.Public)));
3375Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(setAccessor, Accessibility.Private)));
3378Assert.Equal(0, Generator.GetStatements(getAccessor).Count);
3379Assert.Equal(0, Generator.GetStatements(setAccessor).Count);
3381var newGetAccessor = Generator.WithStatements(getAccessor, null);
3385var newNewGetAccessor = Generator.WithStatements(newGetAccessor, []);
3392var newProp = Generator.ReplaceNode(prop, getAccessor, Generator.WithAccessibility(getAccessor, Accessibility.Public));
3393Assert.Equal(Accessibility.Public, Generator.GetAccessibility(Generator.GetAccessor(newProp, DeclarationKind.GetAccessor)));
3395newProp = Generator.ReplaceNode(prop, setAccessor, Generator.WithAccessibility(setAccessor, Accessibility.Public));
3396Assert.Equal(Accessibility.Public, Generator.GetAccessibility(Generator.GetAccessor(newProp, DeclarationKind.SetAccessor)));
3403Generator.WithAccessorDeclarations(Generator.PropertyDeclaration("p", Generator.IdentifierName("x"))),
3407Generator.WithAccessorDeclarations(
3408Generator.PropertyDeclaration("p", Generator.IdentifierName("x")),
3409Generator.GetAccessorDeclaration(Accessibility.NotApplicable, [Generator.ReturnStatement()])),
3413Generator.WithAccessorDeclarations(
3414Generator.PropertyDeclaration("p", Generator.IdentifierName("x")),
3415Generator.GetAccessorDeclaration(Accessibility.Protected, [Generator.ReturnStatement()])),
3419Generator.WithAccessorDeclarations(
3420Generator.PropertyDeclaration("p", Generator.IdentifierName("x")),
3421Generator.SetAccessorDeclaration(Accessibility.Protected, [Generator.ReturnStatement()])),
3425Generator.WithAccessorDeclarations(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))], Generator.IdentifierName("x"))),
3429Generator.WithAccessorDeclarations(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))], Generator.IdentifierName("x")),
3430Generator.GetAccessorDeclaration(Accessibility.Protected, [Generator.ReturnStatement()])),
3434Generator.WithAccessorDeclarations(
3435Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))], Generator.IdentifierName("x")),
3436Generator.SetAccessorDeclaration(Accessibility.Protected, [Generator.ReturnStatement()])),
3449var x = Generator.GetMembers(root.Members[0])[0];
3450var y = Generator.GetMembers(root.Members[0])[1];
3452Assert.Equal(2, Generator.GetAccessors(x).Count);
3453Assert.Equal(0, Generator.GetAccessors(y).Count);
3456var y2 = Generator.AddAccessors(y, [Generator.GetAccessor(x, DeclarationKind.GetAccessor)]);
3458Assert.Equal(0, Generator.GetAccessors(y2).Count);
3470var x = Generator.GetMembers(root.Members[0])[0];
3471var y = Generator.GetMembers(root.Members[0])[1];
3473Assert.Equal(2, Generator.GetAccessors(x).Count);
3474Assert.Equal(0, Generator.GetAccessors(y).Count);
3477var y2 = Generator.AddAccessors(y, [Generator.GetAccessor(x, DeclarationKind.GetAccessor)]);
3479Assert.Equal(0, Generator.GetAccessors(y2).Count);
3493var x = Generator.GetMembers(root.Members[0])[0];
3494var y = Generator.GetMembers(root.Members[0])[1];
3495var z = Generator.GetMembers(root.Members[0])[2];
3497Assert.NotNull(Generator.GetExpression(x));
3498Assert.NotNull(Generator.GetExpression(y));
3499Assert.Null(Generator.GetExpression(z));
3500Assert.Equal("100", Generator.GetExpression(x).ToString());
3501Assert.Equal("300", Generator.GetExpression(y).ToString());
3503Assert.Equal("500", Generator.GetExpression(Generator.WithExpression(x, Generator.LiteralExpression(500))).ToString());
3504Assert.Equal("500", Generator.GetExpression(Generator.WithExpression(y, Generator.LiteralExpression(500))).ToString());
3505Assert.Equal("500", Generator.GetExpression(Generator.WithExpression(z, Generator.LiteralExpression(500))).ToString());
3518var x = Generator.GetMembers(root.Members[0])[0];
3519var y = Generator.GetMembers(root.Members[0])[1];
3521Assert.Null(Generator.GetExpression(x));
3522Assert.NotNull(Generator.GetExpression(y));
3523Assert.Equal("p * 10", Generator.GetExpression(y).ToString());
3525Assert.Null(Generator.GetExpression(Generator.WithExpression(x, Generator.LiteralExpression(500))));
3526Assert.Equal("500", Generator.GetExpression(Generator.WithExpression(y, Generator.LiteralExpression(500))).ToString());
3535Generator.ExpressionStatement(Generator.AssignmentStatement(Generator.IdentifierName("x"), Generator.IdentifierName("y"))),
3538Generator.ExpressionStatement(Generator.InvocationExpression(Generator.IdentifierName("fn"), Generator.IdentifierName("arg")))
3541Assert.Equal(0, Generator.GetStatements(Generator.MethodDeclaration("m")).Count);
3542Assert.Equal(2, Generator.GetStatements(Generator.MethodDeclaration("m", statements: stmts)).Count);
3544Assert.Equal(0, Generator.GetStatements(Generator.ConstructorDeclaration()).Count);
3545Assert.Equal(2, Generator.GetStatements(Generator.ConstructorDeclaration(statements: stmts)).Count);
3547Assert.Equal(0, Generator.GetStatements(Generator.VoidReturningLambdaExpression([])).Count);
3548Assert.Equal(2, Generator.GetStatements(Generator.VoidReturningLambdaExpression(stmts)).Count);
3550Assert.Equal(0, Generator.GetStatements(Generator.ValueReturningLambdaExpression([])).Count);
3551Assert.Equal(2, Generator.GetStatements(Generator.ValueReturningLambdaExpression(stmts)).Count);
3553Assert.Equal(0, Generator.GetStatements(Generator.IdentifierName("x")).Count);
3562Generator.ExpressionStatement(Generator.AssignmentStatement(Generator.IdentifierName("x"), Generator.IdentifierName("y"))),
3565Generator.ExpressionStatement(Generator.InvocationExpression(Generator.IdentifierName("fn"), Generator.IdentifierName("arg")))
3568Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.MethodDeclaration("m"), stmts)).Count);
3569Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.ConstructorDeclaration(), stmts)).Count);
3570Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.VoidReturningLambdaExpression([]), stmts)).Count);
3571Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.ValueReturningLambdaExpression([]), stmts)).Count);
3573Assert.Equal(0, Generator.GetStatements(Generator.WithStatements(Generator.IdentifierName("x"), stmts)).Count);
3582Generator.ExpressionStatement(Generator.AssignmentStatement(Generator.IdentifierName("x"), Generator.IdentifierName("y"))),
3585Generator.ExpressionStatement(Generator.InvocationExpression(Generator.IdentifierName("fn"), Generator.IdentifierName("arg")))
3588var p = Generator.ParameterDeclaration("p", Generator.IdentifierName("t"));
3591Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))).Count);
3592Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), getAccessorStatements: stmts)).Count);
3594Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t"))).Count);
3595Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t"), getAccessorStatements: stmts)).Count);
3597Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.IdentifierName("x")).Count);
3600Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))).Count);
3601Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), setAccessorStatements: stmts)).Count);
3603Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t"))).Count);
3604Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t"), setAccessorStatements: stmts)).Count);
3606Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.IdentifierName("x")).Count);
3615Generator.ExpressionStatement(Generator.AssignmentStatement(Generator.IdentifierName("x"), Generator.IdentifierName("y"))),
3618Generator.ExpressionStatement(Generator.InvocationExpression(Generator.IdentifierName("fn"), Generator.IdentifierName("arg")))
3621var p = Generator.ParameterDeclaration("p", Generator.IdentifierName("t"));
3624Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.WithGetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t")), stmts)).Count);
3625Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.WithGetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t")), stmts)).Count);
3626Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.WithGetAccessorStatements(Generator.IdentifierName("x"), stmts)).Count);
3629Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.WithSetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t")), stmts)).Count);
3630Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.WithSetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t")), stmts)).Count);
3631Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.WithSetAccessorStatements(Generator.IdentifierName("x"), stmts)).Count);
3642var baseListBI = Generator.GetBaseAndInterfaceTypes(classBI);
3653var baseListB = Generator.GetBaseAndInterfaceTypes(classB);
3663var baseListN = Generator.GetBaseAndInterfaceTypes(classN);
3676var baseListBI = Generator.GetBaseAndInterfaceTypes(classBI);
3680Generator.RemoveNode(classBI, baseListBI[0]),
3686Generator.RemoveNode(classBI, baseListBI[1]),
3692Generator.RemoveNodes(classBI, baseListBI),
3717Generator.AddBaseType(classC, Generator.IdentifierName("T")),
3723Generator.AddBaseType(classCI, Generator.IdentifierName("T")),
3730Generator.AddBaseType(classCB, Generator.IdentifierName("T")),
3755Generator.AddInterfaceType(classC, Generator.IdentifierName("T")),
3761Generator.AddInterfaceType(classCI, Generator.IdentifierName("T")),
3767Generator.AddInterfaceType(classCB, Generator.IdentifierName("T")),
3787var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First());
3788var declX = Generator.GetDeclaration(symbolX.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First());
3789var declY = Generator.GetDeclaration(symbolY.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First());
3790var declZ = Generator.GetDeclaration(symbolZ.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First());
3792Assert.Equal(DeclarationKind.Field, Generator.GetDeclarationKind(declX));
3793Assert.Equal(DeclarationKind.Field, Generator.GetDeclarationKind(declY));
3794Assert.Equal(DeclarationKind.Field, Generator.GetDeclarationKind(declZ));
3796Assert.NotNull(Generator.GetType(declX));
3797Assert.Equal("int", Generator.GetType(declX).ToString());
3798Assert.Equal("X", Generator.GetName(declX));
3799Assert.Equal(Accessibility.Public, Generator.GetAccessibility(declX));
3800Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(declX));
3802Assert.NotNull(Generator.GetType(declY));
3803Assert.Equal("int", Generator.GetType(declY).ToString());
3804Assert.Equal("Y", Generator.GetName(declY));
3805Assert.Equal(Accessibility.Public, Generator.GetAccessibility(declY));
3806Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(declY));
3808Assert.NotNull(Generator.GetType(declZ));
3809Assert.Equal("int", Generator.GetType(declZ).ToString());
3810Assert.Equal("Z", Generator.GetName(declZ));
3811Assert.Equal(Accessibility.Public, Generator.GetAccessibility(declZ));
3812Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(declZ));
3814var xTypedT = Generator.WithType(declX, Generator.IdentifierName("T"));
3815Assert.Equal(DeclarationKind.Field, Generator.GetDeclarationKind(xTypedT));
3817Assert.Equal("T", Generator.GetType(xTypedT).ToString());
3819var xNamedQ = Generator.WithName(declX, "Q");
3820Assert.Equal(DeclarationKind.Field, Generator.GetDeclarationKind(xNamedQ));
3822Assert.Equal("Q", Generator.GetName(xNamedQ).ToString());
3824var xInitialized = Generator.WithExpression(declX, Generator.IdentifierName("e"));
3825Assert.Equal(DeclarationKind.Field, Generator.GetDeclarationKind(xInitialized));
3827Assert.Equal("e", Generator.GetExpression(xInitialized).ToString());
3829var xPrivate = Generator.WithAccessibility(declX, Accessibility.Private);
3830Assert.Equal(DeclarationKind.Field, Generator.GetDeclarationKind(xPrivate));
3832Assert.Equal(Accessibility.Private, Generator.GetAccessibility(xPrivate));
3834var xReadOnly = Generator.WithModifiers(declX, DeclarationModifiers.ReadOnly);
3835Assert.Equal(DeclarationKind.Field, Generator.GetDeclarationKind(xReadOnly));
3837Assert.Equal(DeclarationModifiers.ReadOnly, Generator.GetModifiers(xReadOnly));
3839var xAttributed = Generator.AddAttributes(declX, Generator.Attribute("A"));
3840Assert.Equal(DeclarationKind.Field, Generator.GetDeclarationKind(xAttributed));
3842Assert.Equal(1, Generator.GetAttributes(xAttributed).Count);
3843Assert.Equal("[A]", Generator.GetAttributes(xAttributed)[0].ToString());
3845var membersC = Generator.GetMembers(declC);
3852Generator.InsertMembers(declC, 0, Generator.FieldDeclaration("A", Generator.IdentifierName("T"))),
3860Generator.InsertMembers(declC, 1, Generator.FieldDeclaration("A", Generator.IdentifierName("T"))),
3869Generator.InsertMembers(declC, 2, Generator.FieldDeclaration("A", Generator.IdentifierName("T"))),
3878Generator.InsertMembers(declC, 3, Generator.FieldDeclaration("A", Generator.IdentifierName("T"))),
3886Generator.ClassDeclaration("C", members: [declX, declY]),
3894Generator.ReplaceNode(declC, declX, xTypedT),
3902Generator.ReplaceNode(declC, declY, Generator.WithType(declY, Generator.IdentifierName("T"))),
3911Generator.ReplaceNode(declC, declZ, Generator.WithType(declZ, Generator.IdentifierName("T"))),
3919Generator.ReplaceNode(declC, declX, Generator.WithAccessibility(declX, Accessibility.Private)),
3927Generator.ReplaceNode(declC, declX, Generator.WithModifiers(declX, DeclarationModifiers.None)),
3934Generator.ReplaceNode(declC, declX, Generator.WithName(declX, "Q")),
3940Generator.ReplaceNode(declC, declX.GetAncestorOrThis<VariableDeclaratorSyntax>(), VariableDeclarator("Q")),
3947Generator.ReplaceNode(declC, declX, Generator.WithExpression(declX, Generator.IdentifierName("e"))),
3964var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First());
3967Generator.InsertMembers(declC, 0, Generator.FieldDeclaration("A", Generator.IdentifierName("T"))),
3982var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First());
3985Generator.InsertMembers(declC, 0, Generator.FieldDeclaration("A", Generator.IdentifierName("T"))),
4003var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First());
4006Generator.InsertMembers(declC, 0, Generator.FieldDeclaration("A", Generator.IdentifierName("T"))),
4021var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First());
4024Generator.InsertMembers(declC, 0, Generator.FieldDeclaration("A", Generator.IdentifierName("T"))),
4039var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First());
4042Generator.InsertMembers(declC, 0, Generator.PropertyDeclaration("A", Generator.IdentifierName("T"))),
4057var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First());
4060Generator.InsertMembers(declC, 0, Generator.PropertyDeclaration("A", Generator.IdentifierName("T"))),
4075var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First());
4078Generator.InsertMembers(declC, 0, Generator.EnumMember("A")),
4093var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First());
4096Generator.InsertMembers(declC, 0, Generator.FieldDeclaration("A", Generator.IdentifierName("T"))),
4111var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First());
4114Generator.InsertMembers(declC, 0, Generator.FieldDeclaration("A", Generator.IdentifierName("T"))),
4131var attrs = Generator.GetAttributes(declC);
4138Assert.Equal("X", Generator.GetName(attrX));
4139Assert.Equal("Y", Generator.GetName(attrY));
4140Assert.Equal("Z", Generator.GetName(attrZ));
4142var xNamedQ = Generator.WithName(attrX, "Q");
4143Assert.Equal(DeclarationKind.Attribute, Generator.GetDeclarationKind(xNamedQ));
4147var xWithArg = Generator.AddAttributeArguments(attrX, [Generator.AttributeArgument(Generator.IdentifierName("e"))]);
4148Assert.Equal(DeclarationKind.Attribute, Generator.GetDeclarationKind(xWithArg));
4154Generator.InsertAttributes(declC, 0, Generator.Attribute("A")),
4162Generator.InsertAttributes(declC, 1, Generator.Attribute("A")),
4171Generator.InsertAttributes(declC, 2, Generator.Attribute("A")),
4180Generator.InsertAttributes(declC, 3, Generator.Attribute("A")),
4189Generator.RemoveNodes(declC, [attrX]),
4196Generator.RemoveNodes(declC, [attrY]),
4203Generator.RemoveNodes(declC, [attrZ]),
4210Generator.RemoveNodes(declC, [attrX, attrY]),
4217Generator.RemoveNodes(declC, [attrX, attrZ]),
4224Generator.RemoveNodes(declC, [attrY, attrZ]),
4231Generator.RemoveNodes(declC, [attrX, attrY, attrZ]),
4238Generator.ReplaceNode(declC, attrX, Generator.Attribute("A")),
4245Generator.ReplaceNode(declC, attrY, Generator.Attribute("A")),
4252Generator.ReplaceNode(declC, attrZ, Generator.Attribute("A")),
4259Generator.ReplaceNode(declC, attrX, Generator.AddAttributeArguments(attrX, [Generator.AttributeArgument(Generator.IdentifierName("e"))])),
4283Generator.MethodDeclaration(method),
4287Generator.IndexerDeclaration(indexer),
4291Generator.PropertyDeclaration(property),
4308var declM = Generator.GetMembers(declC).First();
4310Assert.Equal(0, Generator.GetAttributes(declM).Count);
4312var attrs = Generator.GetReturnAttributes(declM);
4318Assert.Equal("X", Generator.GetName(attrX));
4319Assert.Equal("Y", Generator.GetName(attrY));
4320Assert.Equal("Z", Generator.GetName(attrZ));
4322var xNamedQ = Generator.WithName(attrX, "Q");
4323Assert.Equal(DeclarationKind.Attribute, Generator.GetDeclarationKind(xNamedQ));
4327var xWithArg = Generator.AddAttributeArguments(attrX, [Generator.AttributeArgument(Generator.IdentifierName("e"))]);
4328Assert.Equal(DeclarationKind.Attribute, Generator.GetDeclarationKind(xWithArg));
4334Generator.InsertReturnAttributes(declM, 0, Generator.Attribute("A")),
4342Generator.InsertReturnAttributes(declM, 1, Generator.Attribute("A")),
4351Generator.InsertReturnAttributes(declM, 2, Generator.Attribute("A")),
4360Generator.InsertReturnAttributes(declM, 3, Generator.Attribute("A")),
4369Generator.ReplaceNode(declM, attrX, Generator.Attribute("Q")),
4376Generator.ReplaceNode(declM, attrX, Generator.AddAttributeArguments(attrX, [Generator.AttributeArgument(Generator.IdentifierName("e"))])),
4400var declM = Generator.GetMembers(declC).First();
4402var attrs = Generator.GetAttributes(declM);
4406Assert.Equal("X", Generator.GetName(attrX));
4410Assert.Equal("Y", Generator.GetName(attrY));
4414Assert.Equal("Z", Generator.GetName(attrZ));
4418Assert.Equal("P", Generator.GetName(attrP));
4421var rattrs = Generator.GetReturnAttributes(declM);
4425Assert.Equal("A", Generator.GetName(attrA));
4429Assert.Equal("B", Generator.GetName(attrB));
4433Assert.Equal("C", Generator.GetName(attrC));
4437Assert.Equal("D", Generator.GetName(attrD));
4442Generator.InsertAttributes(declM, 0, Generator.Attribute("Q")),
4454Generator.InsertAttributes(declM, 1, Generator.Attribute("Q")),
4466Generator.InsertAttributes(declM, 2, Generator.Attribute("Q")),
4479Generator.InsertAttributes(declM, 3, Generator.Attribute("Q")),
4491Generator.InsertAttributes(declM, 4, Generator.Attribute("Q")),
4503Generator.InsertReturnAttributes(declM, 0, Generator.Attribute("Q")),
4515Generator.InsertReturnAttributes(declM, 1, Generator.Attribute("Q")),
4527Generator.InsertReturnAttributes(declM, 2, Generator.Attribute("Q")),
4540Generator.InsertReturnAttributes(declM, 3, Generator.Attribute("Q")),
4553Generator.InsertReturnAttributes(declM, 4, Generator.Attribute("Q")),
4582var newDecl = Generator.AddInterfaceType(decl, Generator.IdentifierName("IDisposable"));
4598Generator.Declaration(symbolR),
4613Generator.Declaration(symbolR),
4636Generator.Declaration(symbolR),
4651Generator.Declaration(symbolR),
4674Generator.Declaration(symbol),
4694Generator.Declaration(symbol),
4712Generator.Declaration(symbol),
4729Generator.Declaration(symbol),
4754Generator.Declaration(symbol),
4912Generator.Declaration(symbol),
4970Generator.Attribute(attribute),
4978Generator.TypeExpression(type),