536 references to VerifySyntax
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (536)
CodeGeneration\SyntaxGeneratorTests.cs (536)
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( 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>"); 258VerifySyntax<GenericNameSyntax>(gname, "x<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"); 379VerifySyntax<ArrayCreationExpressionSyntax>( 383VerifySyntax<ArrayCreationExpressionSyntax>( 397VerifySyntax<ObjectCreationExpressionSyntax>( 401VerifySyntax<ObjectCreationExpressionSyntax>( 409VerifySyntax<ObjectCreationExpressionSyntax>( 417VerifySyntax<ElementAccessExpressionSyntax>( 421VerifySyntax<ElementAccessExpressionSyntax>( 425VerifySyntax<ElementAccessExpressionSyntax>( 429VerifySyntax<ElementAccessExpressionSyntax>( 433VerifySyntax<ElementAccessExpressionSyntax>( 437VerifySyntax<ElementAccessExpressionSyntax>( 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;"); 503VerifySyntax<AssignmentExpressionSyntax>( 511VerifySyntax<AssignmentExpressionSyntax>( 518=> VerifySyntax<AwaitExpressionSyntax>(Generator.AwaitExpression(Generator.IdentifierName("x")), "await x"); 522=> VerifySyntax<InvocationExpressionSyntax>(Generator.NameOfExpression(Generator.IdentifierName("x")), "nameof(x)"); 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;"); 559VerifySyntax<IfStatementSyntax>( 563VerifySyntax<IfStatementSyntax>( 567VerifySyntax<IfStatementSyntax>( 572VerifySyntax<IfStatementSyntax>( 578VerifySyntax<IfStatementSyntax>( 584VerifySyntax<IfStatementSyntax>( 594VerifySyntax<SwitchStatementSyntax>( 607VerifySyntax<SwitchStatementSyntax>( 623VerifySyntax<SwitchStatementSyntax>( 640VerifySyntax<UsingStatementSyntax>( 644VerifySyntax<UsingStatementSyntax>( 648VerifySyntax<UsingStatementSyntax>( 656VerifySyntax<LockStatementSyntax>( 697VerifySyntax<WhileStatementSyntax>( 702VerifySyntax<WhileStatementSyntax>( 710VerifySyntax<SimpleLambdaExpressionSyntax>( 714VerifySyntax<ParenthesizedLambdaExpressionSyntax>( 718VerifySyntax<ParenthesizedLambdaExpressionSyntax>( 722VerifySyntax<SimpleLambdaExpressionSyntax>( 726VerifySyntax<ParenthesizedLambdaExpressionSyntax>( 730VerifySyntax<ParenthesizedLambdaExpressionSyntax>( 734VerifySyntax<SimpleLambdaExpressionSyntax>( 738VerifySyntax<ParenthesizedLambdaExpressionSyntax>( 742VerifySyntax<ParenthesizedLambdaExpressionSyntax>( 746VerifySyntax<SimpleLambdaExpressionSyntax>( 750VerifySyntax<ParenthesizedLambdaExpressionSyntax>( 754VerifySyntax<ParenthesizedLambdaExpressionSyntax>( 758VerifySyntax<ParenthesizedLambdaExpressionSyntax>( 762VerifySyntax<ParenthesizedLambdaExpressionSyntax>( 766VerifySyntax<ParenthesizedLambdaExpressionSyntax>( 770VerifySyntax<ParenthesizedLambdaExpressionSyntax>( 780VerifySyntax<FieldDeclarationSyntax>( 784VerifySyntax<FieldDeclarationSyntax>( 788VerifySyntax<FieldDeclarationSyntax>( 792VerifySyntax<FieldDeclarationSyntax>( 796VerifySyntax<FieldDeclarationSyntax>( 804VerifySyntax<MethodDeclarationSyntax>( 808VerifySyntax<MethodDeclarationSyntax>( 812VerifySyntax<MethodDeclarationSyntax>( 816VerifySyntax<MethodDeclarationSyntax>( 820VerifySyntax<MethodDeclarationSyntax>( 824VerifySyntax<MethodDeclarationSyntax>( 828VerifySyntax<MethodDeclarationSyntax>( 832VerifySyntax<MethodDeclarationSyntax>( 836VerifySyntax<MethodDeclarationSyntax>( 840VerifySyntax<MethodDeclarationSyntax>( 844VerifySyntax<MethodDeclarationSyntax>( 860VerifySyntax<OperatorDeclarationSyntax>( 864VerifySyntax<OperatorDeclarationSyntax>( 868VerifySyntax<OperatorDeclarationSyntax>( 872VerifySyntax<OperatorDeclarationSyntax>( 876VerifySyntax<OperatorDeclarationSyntax>( 880VerifySyntax<OperatorDeclarationSyntax>( 884VerifySyntax<OperatorDeclarationSyntax>( 888VerifySyntax<OperatorDeclarationSyntax>( 892VerifySyntax<OperatorDeclarationSyntax>( 896VerifySyntax<OperatorDeclarationSyntax>( 900VerifySyntax<OperatorDeclarationSyntax>( 904VerifySyntax<OperatorDeclarationSyntax>( 908VerifySyntax<OperatorDeclarationSyntax>( 912VerifySyntax<OperatorDeclarationSyntax>( 916VerifySyntax<OperatorDeclarationSyntax>( 920VerifySyntax<OperatorDeclarationSyntax>( 924VerifySyntax<OperatorDeclarationSyntax>( 928VerifySyntax<OperatorDeclarationSyntax>( 932VerifySyntax<OperatorDeclarationSyntax>( 936VerifySyntax<OperatorDeclarationSyntax>( 940VerifySyntax<OperatorDeclarationSyntax>( 944VerifySyntax<OperatorDeclarationSyntax>( 948VerifySyntax<OperatorDeclarationSyntax>( 952VerifySyntax<OperatorDeclarationSyntax>( 956VerifySyntax<OperatorDeclarationSyntax>( 962VerifySyntax<ConversionOperatorDeclarationSyntax>( 966VerifySyntax<ConversionOperatorDeclarationSyntax>( 982VerifySyntax<OperatorDeclarationSyntax>(Generator.OperatorDeclaration(operatorSymbol), "public static global::C operator checked ++(global::C x)\r\n{\r\n}"); 992VerifySyntax<ConversionOperatorDeclarationSyntax>( 999VerifySyntax<ConversionOperatorDeclarationSyntax>( 1007VerifySyntax<ConstructorDeclarationSyntax>( 1011VerifySyntax<ConstructorDeclarationSyntax>( 1015VerifySyntax<ConstructorDeclarationSyntax>( 1019VerifySyntax<ConstructorDeclarationSyntax>( 1023VerifySyntax<ConstructorDeclarationSyntax>( 1033VerifySyntax<PropertyDeclarationSyntax>( 1037VerifySyntax<PropertyDeclarationSyntax>( 1041VerifySyntax<PropertyDeclarationSyntax>( 1045VerifySyntax<PropertyDeclarationSyntax>( 1049VerifySyntax<PropertyDeclarationSyntax>( 1053VerifySyntax<PropertyDeclarationSyntax>( 1057VerifySyntax<PropertyDeclarationSyntax>( 1061VerifySyntax<PropertyDeclarationSyntax>( 1065VerifySyntax<PropertyDeclarationSyntax>( 1069VerifySyntax<PropertyDeclarationSyntax>( 1073VerifySyntax<PropertyDeclarationSyntax>( 1077VerifySyntax<PropertyDeclarationSyntax>( 1133VerifySyntax<EventFieldDeclarationSyntax>( 1137VerifySyntax<EventFieldDeclarationSyntax>( 1141VerifySyntax<EventFieldDeclarationSyntax>( 1149VerifySyntax<EventDeclarationSyntax>( 1153VerifySyntax<EventDeclarationSyntax>( 1157VerifySyntax<EventDeclarationSyntax>( 1161VerifySyntax<EventDeclarationSyntax>( 1169VerifySyntax<MethodDeclarationSyntax>( 1175VerifySyntax<PropertyDeclarationSyntax>( 1181VerifySyntax<IndexerDeclarationSyntax>( 1192VerifySyntax<MethodDeclarationSyntax>( 1196VerifySyntax<MethodDeclarationSyntax>( 1336VerifySyntax<PropertyDeclarationSyntax>( 1472VerifySyntax<MethodDeclarationSyntax>( 1478VerifySyntax<PropertyDeclarationSyntax>( 1484VerifySyntax<IndexerDeclarationSyntax>( 1490VerifySyntax<EventDeclarationSyntax>( 1501VerifySyntax<MethodDeclarationSyntax>( 1505VerifySyntax<MethodDeclarationSyntax>( 1525VerifySyntax<MethodDeclarationSyntax>( 1533VerifySyntax<ClassDeclarationSyntax>( 1537VerifySyntax<ClassDeclarationSyntax>( 1541VerifySyntax<ClassDeclarationSyntax>( 1545VerifySyntax<ClassDeclarationSyntax>( 1549VerifySyntax<ClassDeclarationSyntax>( 1553VerifySyntax<ClassDeclarationSyntax>( 1557VerifySyntax<ClassDeclarationSyntax>( 1561VerifySyntax<ClassDeclarationSyntax>( 1565VerifySyntax<ClassDeclarationSyntax>( 1573VerifySyntax<StructDeclarationSyntax>( 1577VerifySyntax<StructDeclarationSyntax>( 1581VerifySyntax<StructDeclarationSyntax>( 1585VerifySyntax<StructDeclarationSyntax>( 1589VerifySyntax<StructDeclarationSyntax>( 1593VerifySyntax<StructDeclarationSyntax>( 1597VerifySyntax<StructDeclarationSyntax>( 1601VerifySyntax<StructDeclarationSyntax>( 1609VerifySyntax<InterfaceDeclarationSyntax>( 1613VerifySyntax<InterfaceDeclarationSyntax>( 1617VerifySyntax<InterfaceDeclarationSyntax>( 1621VerifySyntax<InterfaceDeclarationSyntax>( 1625VerifySyntax<InterfaceDeclarationSyntax>( 1629VerifySyntax<InterfaceDeclarationSyntax>( 1633VerifySyntax<InterfaceDeclarationSyntax>( 1637VerifySyntax<InterfaceDeclarationSyntax>( 1649VerifySyntax<InterfaceDeclarationSyntax>( 1653VerifySyntax<InterfaceDeclarationSyntax>( 1657VerifySyntax<InterfaceDeclarationSyntax>( 1671VerifySyntax<InterfaceDeclarationSyntax>( 1679VerifySyntax<EnumDeclarationSyntax>( 1683VerifySyntax<EnumDeclarationSyntax>( 1687VerifySyntax<EnumDeclarationSyntax>( 1691VerifySyntax<EnumDeclarationSyntax>( 1695VerifySyntax<EnumDeclarationSyntax>( 1703VerifySyntax<DelegateDeclarationSyntax>( 1707VerifySyntax<DelegateDeclarationSyntax>( 1711VerifySyntax<DelegateDeclarationSyntax>( 1715VerifySyntax<DelegateDeclarationSyntax>( 1719VerifySyntax<DelegateDeclarationSyntax>( 1723VerifySyntax<DelegateDeclarationSyntax>( 1727VerifySyntax<DelegateDeclarationSyntax>( 1735VerifySyntax<UsingDirectiveSyntax>( 1739VerifySyntax<UsingDirectiveSyntax>( 1743VerifySyntax<UsingDirectiveSyntax>( 1751VerifySyntax<NamespaceDeclarationSyntax>( 1755VerifySyntax<NamespaceDeclarationSyntax>( 1759VerifySyntax<NamespaceDeclarationSyntax>( 1764VerifySyntax<NamespaceDeclarationSyntax>( 1774VerifySyntax<CompilationUnitSyntax>( 1778VerifySyntax<CompilationUnitSyntax>( 1783VerifySyntax<CompilationUnitSyntax>( 1788VerifySyntax<CompilationUnitSyntax>( 1794VerifySyntax<CompilationUnitSyntax>( 1806VerifySyntax<AttributeListSyntax>( 1810VerifySyntax<AttributeListSyntax>( 1814VerifySyntax<AttributeListSyntax>( 1818VerifySyntax<AttributeListSyntax>( 1822VerifySyntax<AttributeListSyntax>( 1826VerifySyntax<AttributeListSyntax>( 1830VerifySyntax<AttributeListSyntax>( 1834VerifySyntax<AttributeListSyntax>( 1842VerifySyntax<FieldDeclarationSyntax>( 1848VerifySyntax<FieldDeclarationSyntax>( 1856VerifySyntax<MethodDeclarationSyntax>( 1862VerifySyntax<MethodDeclarationSyntax>( 1868VerifySyntax<PropertyDeclarationSyntax>( 1880VerifySyntax<EventDeclarationSyntax>( 1886VerifySyntax<EventFieldDeclarationSyntax>( 1892VerifySyntax<ClassDeclarationSyntax>( 1898VerifySyntax<StructDeclarationSyntax>( 1904VerifySyntax<InterfaceDeclarationSyntax>( 1910VerifySyntax<DelegateDeclarationSyntax>( 1916VerifySyntax<ParameterSyntax>( 1922VerifySyntax<CompilationUnitSyntax>( 1928VerifySyntax<CompilationUnitSyntax>( 1936VerifySyntax<StatementSyntax>( 1942VerifySyntax<TypeParameterSyntax>( 1948VerifySyntax<LambdaExpressionSyntax>( 1987VerifySyntax<ClassDeclarationSyntax>(added, "// comment\r\n[a]\r\npublic class C\r\n{\r\n} // end\r\n"); 1990VerifySyntax<ClassDeclarationSyntax>(removed, "// comment\r\npublic class C\r\n{\r\n} // end\r\n"); 1993VerifySyntax<AttributeListSyntax>(attrWithComment, "// comment\r\n[a]"); 1999VerifySyntax<MethodDeclarationSyntax>( 2005VerifySyntax<MethodDeclarationSyntax>( 2010VerifySyntax<MethodDeclarationSyntax>( 2016VerifySyntax<MethodDeclarationSyntax>( 2022VerifySyntax<ClassDeclarationSyntax>( 2028VerifySyntax<StructDeclarationSyntax>( 2034VerifySyntax<InterfaceDeclarationSyntax>( 2040VerifySyntax<DelegateDeclarationSyntax>( 2050VerifySyntax<MethodDeclarationSyntax>( 2056VerifySyntax<MethodDeclarationSyntax>( 2062VerifySyntax<MethodDeclarationSyntax>( 2068VerifySyntax<MethodDeclarationSyntax>( 2074VerifySyntax<MethodDeclarationSyntax>( 2082VerifySyntax<MethodDeclarationSyntax>( 2088VerifySyntax<MethodDeclarationSyntax>( 2094VerifySyntax<MethodDeclarationSyntax>( 2100VerifySyntax<MethodDeclarationSyntax>( 2106VerifySyntax<MethodDeclarationSyntax>( 2112VerifySyntax<MethodDeclarationSyntax>( 2119VerifySyntax<ClassDeclarationSyntax>( 2127VerifySyntax<StructDeclarationSyntax>( 2135VerifySyntax<InterfaceDeclarationSyntax>( 2143VerifySyntax<DelegateDeclarationSyntax>( 2155VerifySyntax<InterfaceDeclarationSyntax>( 2166VerifySyntax<MethodDeclarationSyntax>( 2177VerifySyntax<EnumDeclarationSyntax>( 2191VerifySyntax<EnumDeclarationSyntax>( 2211VerifySyntax<DelegateDeclarationSyntax>(Generator.Declaration(type), """ 2229VerifySyntax<MethodDeclarationSyntax>( 2250VerifySyntax<MethodDeclarationSyntax>( 2271VerifySyntax<MethodDeclarationSyntax>( 2292VerifySyntax<MethodDeclarationSyntax>( 2313VerifySyntax<ConstructorDeclarationSyntax>( 2335VerifySyntax<PropertyDeclarationSyntax>( 2353VerifySyntax<PropertyDeclarationSyntax>( 2376VerifySyntax<MethodDeclarationSyntax>( 2404VerifySyntax<MethodDeclarationSyntax>( 2432VerifySyntax<MethodDeclarationSyntax>( 2463VerifySyntax<MethodDeclarationSyntax>( 2500VerifySyntax<MethodDeclarationSyntax>( 2507VerifySyntax<PropertyDeclarationSyntax>( 2510VerifySyntax<IndexerDeclarationSyntax>( 2520VerifySyntax<EventFieldDeclarationSyntax>( 2540VerifySyntax<FieldDeclarationSyntax>( 2563VerifySyntax<FieldDeclarationSyntax>( 2573VerifySyntax<FieldDeclarationSyntax>( 2593VerifySyntax<DestructorDeclarationSyntax>( 2768VerifySyntax<InterfaceDeclarationSyntax>(Generator.AddMembers(Generator.InterfaceDeclaration("i"), 2777VerifySyntax<InterfaceDeclarationSyntax>(Generator.AddMembers(Generator.InterfaceDeclaration("i"), 2786VerifySyntax<InterfaceDeclarationSyntax>(Generator.AddMembers(Generator.InterfaceDeclaration("i"), 2803VerifySyntax<InterfaceDeclarationSyntax>(Generator.AddMembers(Generator.InterfaceDeclaration("i"), 2825VerifySyntax<InterfaceDeclarationSyntax>(Generator.AddMembers(Generator.InterfaceDeclaration("i"), 3101VerifySyntax<ConstructorDeclarationSyntax>(ctor, @"static C() 3106VerifySyntax<ConstructorDeclarationSyntax>(publicCtor, @"public C() 3115VerifySyntax<ConstructorDeclarationSyntax>(ctor, @"public C() 3120VerifySyntax<ConstructorDeclarationSyntax>(staticCtor, @"static C() 3130VerifySyntax<ClassDeclarationSyntax>(fileAbstractClass, @"file abstract class C 3140VerifySyntax<ClassDeclarationSyntax>(filePublicClass, @"public class C 3150VerifySyntax<ClassDeclarationSyntax>(fileAbstractClass, @"file abstract class C 3160VerifySyntax<ClassDeclarationSyntax>(filePublicClass, @"file class C 3170VerifySyntax<PropertyDeclarationSyntax>(updatedProperty, "public virtual required int P { get; }"); 3178VerifySyntax<PropertyDeclarationSyntax>(updatedProperty, "public virtual required int P { get; }"); 3188VerifySyntax<PropertyDeclarationSyntax>(updatedProperty, $$"""{{modifier}} required int P { get; }"""); 3358VerifySyntax<AccessorDeclarationSyntax>(getAccessor, 3382VerifySyntax<AccessorDeclarationSyntax>(newGetAccessor, 3386VerifySyntax<AccessorDeclarationSyntax>(newNewGetAccessor, 3402VerifySyntax<PropertyDeclarationSyntax>( 3406VerifySyntax<PropertyDeclarationSyntax>( 3412VerifySyntax<PropertyDeclarationSyntax>( 3418VerifySyntax<PropertyDeclarationSyntax>( 3679VerifySyntax<ClassDeclarationSyntax>( 3685VerifySyntax<ClassDeclarationSyntax>( 3691VerifySyntax<ClassDeclarationSyntax>( 3716VerifySyntax<ClassDeclarationSyntax>( 3722VerifySyntax<ClassDeclarationSyntax>( 3729VerifySyntax<ClassDeclarationSyntax>( 3754VerifySyntax<ClassDeclarationSyntax>( 3760VerifySyntax<ClassDeclarationSyntax>( 3766VerifySyntax<ClassDeclarationSyntax>( 3851VerifySyntax<ClassDeclarationSyntax>( 3859VerifySyntax<ClassDeclarationSyntax>( 3868VerifySyntax<ClassDeclarationSyntax>( 3877VerifySyntax<ClassDeclarationSyntax>( 3885VerifySyntax<ClassDeclarationSyntax>( 3893VerifySyntax<ClassDeclarationSyntax>( 3901VerifySyntax<ClassDeclarationSyntax>( 3910VerifySyntax<ClassDeclarationSyntax>( 3918VerifySyntax<ClassDeclarationSyntax>( 3926VerifySyntax<ClassDeclarationSyntax>( 3933VerifySyntax<ClassDeclarationSyntax>( 3939VerifySyntax<ClassDeclarationSyntax>( 3946VerifySyntax<ClassDeclarationSyntax>( 3966VerifySyntax<RecordDeclarationSyntax>( 3984VerifySyntax<ClassDeclarationSyntax>( 4005VerifySyntax<RecordDeclarationSyntax>( 4023VerifySyntax<StructDeclarationSyntax>( 4041VerifySyntax<InterfaceDeclarationSyntax>( 4059VerifySyntax<InterfaceDeclarationSyntax>( 4077VerifySyntax<EnumDeclarationSyntax>( 4095VerifySyntax<RecordDeclarationSyntax>( 4113VerifySyntax<RecordDeclarationSyntax>( 4153VerifySyntax<ClassDeclarationSyntax>( 4161VerifySyntax<ClassDeclarationSyntax>( 4170VerifySyntax<ClassDeclarationSyntax>( 4179VerifySyntax<ClassDeclarationSyntax>( 4188VerifySyntax<ClassDeclarationSyntax>( 4195VerifySyntax<ClassDeclarationSyntax>( 4202VerifySyntax<ClassDeclarationSyntax>( 4209VerifySyntax<ClassDeclarationSyntax>( 4216VerifySyntax<ClassDeclarationSyntax>( 4223VerifySyntax<ClassDeclarationSyntax>( 4230VerifySyntax<ClassDeclarationSyntax>( 4237VerifySyntax<ClassDeclarationSyntax>( 4244VerifySyntax<ClassDeclarationSyntax>( 4251VerifySyntax<ClassDeclarationSyntax>( 4258VerifySyntax<ClassDeclarationSyntax>( 4282VerifySyntax<MethodDeclarationSyntax>( 4286VerifySyntax<IndexerDeclarationSyntax>( 4290VerifySyntax<PropertyDeclarationSyntax>( 4333VerifySyntax<MethodDeclarationSyntax>( 4341VerifySyntax<MethodDeclarationSyntax>( 4350VerifySyntax<MethodDeclarationSyntax>( 4359VerifySyntax<MethodDeclarationSyntax>( 4368VerifySyntax<MethodDeclarationSyntax>( 4375VerifySyntax<MethodDeclarationSyntax>( 4441VerifySyntax<MethodDeclarationSyntax>( 4453VerifySyntax<MethodDeclarationSyntax>( 4465VerifySyntax<MethodDeclarationSyntax>( 4478VerifySyntax<MethodDeclarationSyntax>( 4490VerifySyntax<MethodDeclarationSyntax>( 4502VerifySyntax<MethodDeclarationSyntax>( 4514VerifySyntax<MethodDeclarationSyntax>( 4526VerifySyntax<MethodDeclarationSyntax>( 4539VerifySyntax<MethodDeclarationSyntax>( 4552VerifySyntax<MethodDeclarationSyntax>( 4597VerifySyntax<RecordDeclarationSyntax>( 4612VerifySyntax<RecordDeclarationSyntax>( 4635VerifySyntax<RecordDeclarationSyntax>( 4650VerifySyntax<RecordDeclarationSyntax>( 4673VerifySyntax<ClassDeclarationSyntax>( 4693VerifySyntax<MethodDeclarationSyntax>( 4711VerifySyntax<PropertyDeclarationSyntax>( 4728VerifySyntax<EventFieldDeclarationSyntax>( 4753VerifySyntax<EventFieldDeclarationSyntax>( 4911VerifySyntax<StructDeclarationSyntax>( 4969VerifySyntax<AttributeListSyntax>( 4977VerifySyntax<TypeSyntax>(