Base:
2597 references to ToString
ILLink.RoslynAnalyzer (2)
Microsoft.Analyzers.Extra (1)
Microsoft.Analyzers.Extra.Tests (2)
Microsoft.Analyzers.Local (1)
Microsoft.AspNetCore.App.Analyzers (1)
Microsoft.AspNetCore.App.CodeFixes (1)
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (1)
Microsoft.CodeAnalysis (4)
Microsoft.CodeAnalysis.CodeStyle (4)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
301id = idNode.ToString();
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp (6)
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (216)
CodeGen\CodeGenDeconstructTests.cs (68)
97Assert.Equal(@"(x, y)", lhs.ToString());
102Assert.Equal(@"new C()", right.ToString());
256Assert.Equal("(x, y) = new C()", deconstruction.ToString());
279Assert.Equal("a = 1", assignment.ToString());
312Assert.Equal(@"foreach (char in s) { }", foreachDeconstruction.ToString());
1129Assert.Equal(@"(i, ""hello"")", tuple.ToString());
1470Assert.Equal("(x, y)", xy.ToString());
1511Assert.Equal("(x, y) = new C(1)", tuple1.Parent.ToString());
1516Assert.Equal("(x, y) = new C(2)", tuple2.Parent.ToString());
1564Assert.Equal("(x, y) = new C()", tuple.Parent.ToString());
2288Assert.Equal(@"(x, (y, z)) = Tuple.Create(1, Tuple.Create(""hello"", ""world""))", deconstruction.ToString());
2689Assert.Equal(@"(x, (y, z))", lhs.ToString());
3131Assert.Equal(@"var (x1, (x2, x3))", lhs.ToString());
3136Assert.Equal(@"(x2, x3)", lhsNested.ToString());
3179Assert.Equal(@"(int x1, var (x2, (x3, x4)), var x5)", lhs.ToString());
3185Assert.Equal(@"var (x2, (x3, x4))", x234.ToString());
3190Assert.Equal(@"(x3, x4)", x34.ToString());
3243Assert.Equal(@"(x1, (x2, x3))", x123.ToString());
3249Assert.Equal(@"(x2, x3)", x23.ToString());
3281Assert.Equal("(var x1, var (x2, x3))", lhs.ToString());
3287Assert.Equal("var (x2, x3)", lhsNested.ToString());
3331Assert.Equal("(var x1, byte _, var (x2, x3))", lhs.ToString());
3337Assert.Equal("var (x2, x3)", lhsNested.ToString());
3444Assert.Equal(@"(string x1, byte x2, var x3)", lhs.ToString());
3448Assert.Equal(@"(null, 2, 3)", literal.ToString());
3480Assert.Equal(@"(string x1, var x2)", lhs.ToString());
3484Assert.Equal(@"(null, (1, 2))", literal.ToString());
3490Assert.Equal(@"(1, 2)", nestedLiteral.ToString());
3758Assert.Equal("var", x34Var.Type.ToString());
3852Assert.Equal("var", x12Var.Type.ToString());
4037Assert.Equal("var", x12Var.Type.ToString());
4145Assert.Equal("var", x12Var.Type.ToString());
4228Assert.Equal("var", x12Var.Type.ToString());
4339Assert.Equal("var", x12Var.Type.ToString());
4406Assert.Equal("x", collection.ToString());
4460Assert.Equal("var", x23Var.Type.ToString());
4606Assert.Equal("var", x23Var.Type.ToString());
5193Assert.Equal("var", x23Var.Type.ToString());
5740Assert.Equal("var", x123Var.Type.ToString());
5782Assert.Equal("var", x123Var.Type.ToString());
5912Assert.Equal("int _", declaration1.ToString());
5920Assert.Equal("var _", declaration2.ToString());
5926Assert.Equal("var (_, z)", declaration3.ToString());
6255Assert.Equal("(_, var x)", discard.Parent.Parent.ToString());
6310Assert.Equal("(_, x)", tuple1.ToString());
6340Assert.Equal("var (_, x)", tuple1.ToString());
6368Assert.Equal("(_, x)", discard.Parent.Parent.ToString());
6399Assert.Equal("var (_, x)", declaration1.ToString());
6404Assert.Equal("(_, (var y, int z))", discard2.Parent.Parent.ToString());
6409Assert.Equal("(var y, int z)", yz.ToString());
6414Assert.Equal("var y", y.ToString());
6445Assert.Equal("(_, _)", tuple.ToString());
6862Assert.Equal("string _", declaration1.ToString());
6868Assert.Equal("alias _", declaration2.ToString());
6873Assert.Equal("(string _, alias _)", tuple.ToString());
6934Assert.Equal("var (_, x3)", nestedDeclaration.ToString());
6941Assert.Equal("(var _, var (_, x3))", tuple.ToString());
6980Assert.Equal("var _", declaration1.ToString());
6989Assert.Equal("int _", declaration2.ToString());
6994Assert.Equal("_", discard3.Parent.ToString());
7008Assert.Equal("var (_, _)", nestedDeclaration.ToString());
7239Assert.Equal(@"(int x1, z)", lhs.ToString());
7521Assert.Equal(@"(int x, (y, var z))", lhs.ToString());
8360Assert.Equal("((int, int))(y, b)", node.ToString());
8587Assert.Equal("((byte, byte))(new C(), new D())", node.ToString());
8631Assert.Equal("((int, int))(1L, 2L)", node.ToString());
8651Assert.Equal("((short, short))((int, int))(1L, 2L)", node.Parent.ToString());
9011Assert.Equal("var (y1, y2) =", node.ToString());
CodeGen\CodeGenTupleEqualityTests.cs (68)
363Assert.Equal("(x, x)", tupleX.ToString());
368Assert.Equal("x", lastX.ToString());
382Assert.Equal("(y, y)", tupleY.ToString());
386Assert.Equal("y", lastY.ToString());
717Assert.Equal("t", t.ToString());
727Assert.Equal("(1L, 2)", tuple.ToString());
794Assert.Equal("(s, null)", tuple1.ToString());
807Assert.Equal("(null, s)", tuple2.ToString());
858Assert.Equal("t1", t1.ToString());
867Assert.Equal("(1L, 2)", tuple.ToString());
875Assert.Equal("2", two.ToString());
906Assert.Equal("t1", t1.ToString());
915Assert.Equal("(1L, 2)", tuple.ToString());
923Assert.Equal("2", two.ToString());
955Assert.Equal("t1", t1.ToString());
965Assert.Equal("(1L, t2)", tuple.ToString());
971Assert.Equal("t2", t2.ToString());
1002Assert.Equal("(null, null)", tuple.ToString());
1010Assert.Equal("(1, (null, null))", lastTuple.ToString());
1060Assert.Equal("default", literal.ToString());
1094Assert.Equal("default", literal.ToString());
1126Assert.Equal("default", literal.ToString());
1157Assert.Equal("default", literal.ToString());
1313Assert.Equal("(default, default)", lastTuple.ToString());
1318Assert.Equal("default", lastDefault.ToString());
1400Assert.Equal("null", nullLiteral.ToString());
1404Assert.Equal("null", nullLiteral2.ToString());
1413Assert.Equal("default", defaultLiteral.ToString());
1469Assert.Equal("default", defaultLiteral.ToString());
1498Assert.Equal("((null, null), t)", tuple.ToString());
1507Assert.Equal("t", t.ToString());
1518Assert.Equal("(null, null)", nestedTuple.ToString());
1529Assert.Equal("null", nestedNull.ToString());
1560Assert.Equal("null", literal.ToString());
1569Assert.Equal("(null, null)", tuple.ToString());
1595Assert.Equal("2", lastLiteral.ToString());
1620Assert.Equal("((null, 2), null)", rightTuple.ToString());
1626Assert.Equal("(null, 2)", nestedTuple.ToString());
1632Assert.Equal("2", two.ToString());
1676Assert.Equal("(null, null, null, null)", tuple1.ToString());
1684Assert.Equal("(null, x => x, Main, (int i) => { int j = 0; return i + j; })", tuple2.ToString());
1708Assert.Equal("i + j", addition.ToString());
1777Assert.Equal("(s, s)", tuple1.ToString());
1783Assert.Equal("(1, () => { })", tuple2.ToString());
1919Assert.Equal("(d1, null)", tuple1.ToString());
1925Assert.Equal("(null, d2)", tuple2.ToString());
2576Assert.Equal("(0, 1)", intTuple.ToString());
2584Assert.Equal("(this, this)", lastTuple.ToString());
2644Assert.Equal("t1", t1.ToString());
3281Assert.Equal("nt1", nt1.ToString());
3287Assert.Equal("nt2", nt2.ToString());
3687Assert.Equal("nt1", nt1.ToString());
3693Assert.Equal("nt2", nt2.ToString());
3811Assert.Equal("nt1", nt1.ToString());
3817Assert.Equal("nt2", nt2.ToString());
3914Assert.Equal("nt1", nt1.ToString());
3920Assert.Equal("nt2", nt2.ToString());
4039Assert.Equal("(1, 2)", tuple.ToString());
4045Assert.Equal("nt", nt.ToString());
4084Assert.Equal("(1, 2) == nt", comparison.ToString());
4087Assert.Equal("(1, 2)", tuple.ToString());
4093Assert.Equal("nt", nt.ToString());
4185Assert.Equal("null", lastNull.ToString());
4277Assert.Equal("t.Rest == t.Rest", comparison.ToString());
5162Assert.Equal("((string, (byte, long))) (null, (1, 2L))", leftCast.ToString());
5170Assert.Equal("(null, (1, 2L))", leftTuple.ToString());
5178Assert.Equal("null", leftNull.ToString());
5186Assert.Equal("(1, 2L)", leftNestedTuple.ToString());
CodeGen\CodeGenTupleTest.cs (72)
1612Assert.Equal(@"(1, ""hello"", c: 2)", node.ToString());
4156var node = nodes.OfType<MemberAccessExpressionSyntax>().Where(n => n.ToString() == "x.Rest").First();
4840Assert.Equal("i.M((null, null))", invocation1.ToString());
4845Assert.Equal("c.M((null, null))", invocation2.ToString());
5076Assert.Equal("d.M((1, 2))", invocation.ToString());
5120Assert.Equal("d.M((1, 2))", invocation.ToString());
5161Assert.Equal("d.P", memberAccess.ToString());
5165Assert.Equal("this.P", memberAccess2.ToString());
5169Assert.Equal("base.P", memberAccess3.ToString());
5205Assert.Equal("d.E()", invocation.ToString());
7499Assert.Equal("((int, string)?) (1, null)", value.ToString());
7503Assert.Equal("(1, null)", tuple.ToString());
7532Assert.Equal("(1, null)", value.ToString());
7571Assert.Equal("(1, null)", tuple1.ToString());
7580Assert.Equal("(2, null)", tuple2.ToString());
7589Assert.Equal("(3, null)", tuple3.ToString());
7637Assert.Equal(expected, tuple.ToString());
8294Assert.Equal(@"(e: 1, f: ""hello"")", node.ToString());
8326Assert.Equal(@"11", l11.ToString());
8333Assert.Equal(@"(e: 1, f: ""hello"")", node.ToString());
8380Assert.Equal(@"(1, ""hello"")", node.ToString());
8409Assert.Equal(@"(e: 1, f: ""hello"")", node.ToString());
8438Assert.Equal(@"(e: 1, f: ""hello"")", node.ToString());
8486Assert.Equal(@"((long c, string d))(x)", node.ToString());
8493Assert.Equal(@"(x)", node.ToString());
8520Assert.Equal(@"((long c, string d))(x)", node.ToString());
8527Assert.Equal(@"(x)", node.ToString());
8553Assert.Equal(@"(e: 1, f: ""hello"")", node.ToString());
8582Assert.Equal(@"(e: 1, f: ""hello"")", node.ToString());
8629Assert.Equal(@"(e: 1, f: ""hello"")", node.ToString());
8664Assert.Equal(@"(e: 1, f: ""hello"")", node.ToString());
8693Assert.Equal(@"(e: 1, f: ""hello"")", node.ToString());
8722Assert.Equal(@"(e: 1, f: ""hello"")", node.ToString());
8753Assert.Equal(@"11", l11.ToString());
8760Assert.Equal(@"(e: 1, f: ""hello"")", node.ToString());
8807Assert.Equal(@"(e: 1, f: null)", node.ToString());
8838Assert.Equal(@"null", lnull.ToString());
8845Assert.Equal(@"(e: 1, f: null)", node.ToString());
8896Assert.Equal(@"(e: 1, f: new C1(""qq""))", node.ToString());
8943Assert.Equal(@"(e: 1, f: new C1(""qq""))", node.ToString());
9016Assert.Equal(@"(1, ""qq"")", node.ToString());
9073Assert.Equal(@"(""1"", ""qq"")", node.ToString());
9145Assert.Equal(@"(1, ""qq"")", node.ToString());
9226Assert.Equal(@"(1, ""qq"")", node.ToString());
9309Assert.Equal(@"(1, null)", node.ToString());
16542Assert.Equal(@"(1, ""hello"")", node.ToString());
17214Assert.Equal(@"(1, ""hello"")", n1.ToString());
17221Assert.Equal(@"(2, null)", n2.ToString());
17228Assert.Equal(@"11", n3.ToString());
17235Assert.Equal(@"null", n4.ToString());
17242Assert.Equal(@"() => 12", n5.ToString());
17275Assert.Equal(@"(1, ""hello"")", n1.ToString());
17282Assert.Equal(@"(2, null)", n2.ToString());
17289Assert.Equal(@"11", n3.ToString());
17296Assert.Equal(@"null", n4.ToString());
17303Assert.Equal(@"() => 12", n5.ToString());
17334Assert.Equal(@"(1, ""hello"")", n1.ToString());
17341Assert.Equal(@"(2, null)", n2.ToString());
17404Assert.Equal("x1.Bob", x1Bob.ToString());
17437Assert.Equal("x1 = (Bob, Bob)", x1.ToString());
24184Assert.Equal("tuple.elem2 = 23", nodes[0].Parent.Parent.ToString());
24187Assert.Equal("elem2 = 10", nodes[1].Parent.ToString());
24190Assert.Equal("(tuple.elem2)", nodes[2].Parent.Parent.Parent.ToString());
24193Assert.Equal("(elem2)", nodes[3].Parent.Parent.ToString());
25054Assert.Equal("()", y.ToString());
25059Assert.Equal("(int a)", z.ToString());
25085Assert.Equal("(Alice: 1)", tuple.ToString());
26226Assert.Equal("(A: 0, B: null)", node.ToString());
26296Assert.Equal("impl.Do(((int x, int y) a) => a.x * a.y)", doSyntax.ToString());
26329Assert.Equal("impl.Do(((int x, int y) a) => a.x * a.y)", doSyntax.ToString());
26362Assert.Equal("impl.Do(((int, int) a) => a.Item1 * a.Item2)", doSyntax.ToString());
26395Assert.Equal("impl.Do((dynamic a) => 1)", doSyntax.ToString());
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (23)
CodeGen\IndexAndRangeTests.cs (18)
92Assert.Equal("new Buffer10() { [Id(^1)] = Id(2) }", node.ToString());
333Assert.Equal("new Buffer10() { [Id(^1)] = { F = { } } }", node.ToString());
420Assert.Equal("new Buffer10() { [Id(^1)] = { F = { } } }", node.ToString());
507Assert.Equal("new Buffer10() { [Id(^1)] = { F = { } } }", node.ToString());
625Assert.Equal("new C() { F = {[Id(^1)] = Id(42), [Id(^2)] = Id(43)} }", node.ToString());
1574Assert.Equal("new Buffer10Container() { [i1] = { [i2] = 42, [i3] = 43 } }", node.ToString());
1809Assert.Equal("new Buffer10() { [Id(i1)] = { X = Id(1) }, [Id(i2)] = { }, [Id(i3)] = { X = Id(2) } }", node.ToString());
2264Assert.Equal("new C() { F = { [Id(r)] = { [Id(1)] = Id(42), [Id(2)] = Id(43) } } }", node.ToString());
2679Assert.Equal("new C() { F = { [Id(r)] = { [Id(r2)] = { } } } }", node.ToString());
2842Assert.Equal("new C() { F = { [Id(r)] = { [Id(r2)] = { }, [Id(r3)] = { [Id(i4)] = Id(i5) } } } }", node.ToString());
3020Assert.Equal("new C() { F = { [Id(i1)] = { [Id(i2)] = { } } } }", node.ToString());
3134Assert.Equal("new C() { F = { [Id(i1)] = { [Id(i2)] = { }, [Id(i3)] = { [Id(i4)] = Id(i5) } } } }", node.ToString());
3305Assert.Equal("new C() { F = { [Id(r1)] = { [Id(r2)] = { } } } }", node.ToString());
3456Assert.Equal("new C() { F = { [Id(r1)] = { [Id(0)] = { X = Id(42) } } } }", node.ToString());
3642Assert.Equal("new C(pp) { F = { [Id(0)] = { [Id(1)] = { } } } }", node.ToString());
3732Assert.Equal("new C() { F = { [Id(0)] = { [Id(1)] = { } } } }", node.ToString());
3818Assert.Equal("new C() { [Id(0)] = { [Id(1)] = { } } }", node.ToString());
3891Assert.Equal("new C() { [Id(0)] = { [Id(1)] = { }, [Id(2)] = { F = Id(3) } } }", node.ToString());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (365)
Attributes\AttributeTests.cs (31)
591Assert.Equal("a: true", attributeData.GetAttributeArgumentSyntax(parameterIndex: 0).ToString());
592Assert.Equal(@"b: new object[] { ""Hello"", ""World"" }", attributeData.GetAttributeArgumentSyntax(parameterIndex: 1).ToString());
622Assert.Equal("a: 2", attributeData.GetAttributeArgumentSyntax(parameterIndex: 0).ToString());
623Assert.Equal("b: 0", attributeData.GetAttributeArgumentSyntax(parameterIndex: 1).ToString());
624Assert.Equal("c: 1", attributeData.GetAttributeArgumentSyntax(parameterIndex: 2).ToString());
1125Assert.Equal(@"a: true", attributeData.GetAttributeArgumentSyntax(parameterIndex: 0).ToString());
1126Assert.Equal(@"b: new object[] { ""Hello"", ""World"" }", attributeData.GetAttributeArgumentSyntax(parameterIndex: 1).ToString());
1129Assert.Equal(@"true", attributeData.GetAttributeArgumentSyntax(parameterIndex: 0).ToString());
1130Assert.Equal(@"""Hello""", attributeData.GetAttributeArgumentSyntax(parameterIndex: 1).ToString());
1133Assert.Equal(@"false", attributeData.GetAttributeArgumentSyntax(parameterIndex: 0).ToString());
1134Assert.Equal(@"""World""", attributeData.GetAttributeArgumentSyntax(parameterIndex: 1).ToString());
1137Assert.Equal(@"true", attributeData.GetAttributeArgumentSyntax(parameterIndex: 0).ToString());
1138Assert.Equal(@"Mark", attributeData.GetAttributeArgumentSyntax(parameterIndex: 1).ToString());
1141Assert.Equal(@"a: true", attributeData.GetAttributeArgumentSyntax(parameterIndex: 0).ToString());
1142Assert.Equal(@"Mark", attributeData.GetAttributeArgumentSyntax(parameterIndex: 1).ToString());
1145Assert.Equal(@"a: false", attributeData.GetAttributeArgumentSyntax(parameterIndex: 0).ToString());
1146Assert.Equal(@"b: ""M5""", attributeData.GetAttributeArgumentSyntax(parameterIndex: 1).ToString());
1149Assert.Equal(@"a: true", attributeData.GetAttributeArgumentSyntax(parameterIndex: 0).ToString());
1150Assert.Equal(@"b: ""M6""", attributeData.GetAttributeArgumentSyntax(parameterIndex: 1).ToString());
1189Assert.Equal(@"a: true", attributeData.GetAttributeArgumentSyntax(parameterIndex: 0).ToString());
1190Assert.Equal(@"b: ""Hello""", attributeData.GetAttributeArgumentSyntax(parameterIndex: 1).ToString());
1228Assert.Equal(@"true", attributeData.GetAttributeArgumentSyntax(parameterIndex: 0).ToString());
1229Assert.Equal(@"new object[] { ""Hello"" }", attributeData.GetAttributeArgumentSyntax(parameterIndex: 1).ToString());
1267Assert.Equal(@"a: true", attributeData.GetAttributeArgumentSyntax(parameterIndex: 0).ToString());
1268Assert.Equal(@"new object[] { ""Hello"" }", attributeData.GetAttributeArgumentSyntax(parameterIndex: 1).ToString());
1305Assert.Equal(@"a: true", attributeData.GetAttributeArgumentSyntax(parameterIndex: 0).ToString());
1306Assert.Equal(@"b: null", attributeData.GetAttributeArgumentSyntax(parameterIndex: 1).ToString());
7581Assert.Equal("T", typeofArgSyntax.ToString());
11638Assert.Equal("SomeProperty = 1", firstArgument.ToString());
11642Assert.Equal("F = null", secondArgument.ToString());
11646Assert.Equal("G = 0 switch { _ => 1 }", thirdArgument.ToString());
FlowAnalysis\RegionAnalysisTests.cs (13)
4526var stmt1 = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<StatementSyntax>().Where(n => n.ToString() == "IntPtr p;").Single();
4527var stmt2 = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<StatementSyntax>().Where(n => n.ToString().StartsWith(keyword)).First();
6382Assert.Equal("this.EditorOperations = 1;", statement.ToString());
14172Assert.Equal("int k = i + j + 1;", decl.ToString());
14179Assert.Equal("i + j + 1", add.ToString());
14184Assert.Equal("i + j", add.ToString());
14208Assert.Equal("_ = i + j + k + l;", decl.ToString());
14215Assert.Equal("i + j + k + l", add.ToString());
14220Assert.Equal("i + j + k", add.ToString());
14225Assert.Equal("i + j", add.ToString());
14253Assert.Equal("_ = c?.M(out x) == y == z;", decl.ToString());
14262Assert.Equal("c?.M(out x) == y == z", binOp.ToString());
14268Assert.Equal("c?.M(out x) == y", binOp.ToString());
Semantics\InlineArrayTests.cs (17)
2360Assert.Equal("b[c]", c.Parent.Parent.Parent.ToString());
2395Assert.Equal("b[c]", c.Parent.Parent.Parent.ToString());
2429Assert.Equal("b[c]", c.Parent.Parent.Parent.ToString());
2509Assert.Equal("x.F[0]", f.Parent.Parent.ToString());
6034Assert.Equal("x.F[^10]", f.Parent.Parent.ToString());
6200Assert.Equal("x.F[..5]", f.Parent.Parent.ToString());
8119Assert.Equal("[0]", f.ToString());
8836Assert.Equal("M3()[0]", m3.Parent.ToString());
9204Assert.Equal("M3()[..]", m3.Parent.Parent.ToString());
10548Assert.Equal("c.F[0]", f.Parent.Parent.ToString());
11292Assert.Equal("c.F[..5]", f.Parent.Parent.ToString());
15210Assert.Equal("=> x.F", f[^2].Parent.Parent.ToString());
15217Assert.Equal("=> x.F", f[^1].Parent.Parent.ToString());
16497Assert.Equal("M3()", m3.ToString());
18584Assert.Equal("x.F", f.ToString());
18910Assert.Equal("x.F", f.ToString());
19247Assert.Equal("GetBuffer(x)", collection.ToString());
Semantics\OutVarTests.cs (44)
20052Assert.Equal("System.Console.WriteLine(y)", yRef[2].Parent.Parent.Parent.ToString());
32983Assert.Equal("int _", declaration1.ToString());
32992Assert.Equal("var _", declaration2.ToString());
33067Assert.Equal("int _", declaration1.ToString());
33071Assert.Equal("int", declaration1.Type.ToString());
33083Assert.Equal("var _", declaration2.ToString());
33087Assert.Equal("var", declaration2.Type.ToString());
33139Assert.Equal("long _", declaration1.ToString());
33143Assert.Equal("long", declaration1.Type.ToString());
33181Assert.Equal("alias1 _", declaration1.ToString());
33185Assert.Equal("alias1", declaration1.Type.ToString());
33197Assert.Equal("var _", declaration2.ToString());
33201Assert.Equal("var", declaration2.Type.ToString());
33245Assert.Equal("alias1 _", declaration1.ToString());
33249Assert.Equal("alias1", declaration1.Type.ToString());
33261Assert.Equal("var _", declaration2.ToString());
33266Assert.Equal("var", declaration2.Type.ToString());
33506var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "x").Single();
33507Assert.Equal("x", x.ToString());
35180Assert.Equal("var", varType.ToString());
35219Assert.Equal("var", varType.ToString());
35263Assert.Equal("var", varType.ToString());
35294Assert.Equal("var", varType.ToString());
35333Assert.Equal("var", varType.ToString());
35365Assert.Equal("var", varType.ToString());
35401Assert.Equal("var", varType.ToString());
35440Assert.Equal("var", varType.ToString());
35470Assert.Equal("var", varType.ToString());
35507Assert.Equal("var", varType.ToString());
35854Assert.Equal("new T(out var z)", node.ToString());
35900Assert.Equal("new T(out var z) {F1 = 1}", node.ToString());
35984Assert.Equal(": this(out var x)", initializerSyntax.ToString());
36003Assert.Equal("{ M(out var y); }", blockBodySyntax.ToString());
36028Assert.Equal("=> M(out var z)", expressionBodySyntax.ToString());
36124Assert.Equal("=> M(out var y)", expressionBodySyntax.ToString());
36148Assert.Equal("{return M(out var x);}", blockBodySyntax.ToString());
36172Assert.Equal("=> M(out var z)", propertyExpressionBodySyntax.ToString());
36232Assert.Equal("=> M(out var z)", node3.ToString());
36367Assert.Equal("M2(out var x)", invocation.ToString());
36413Assert.Equal("M2(out var x)", invocation.ToString());
36453Assert.Equal("M2(out var x)", invocation.ToString());
36495Assert.Equal(@"M2(out var a, ""b"")", invocation.ToString());
36530Assert.Equal("M2(out var x)", invocation.ToString());
36568Assert.Equal(@"M2(out var a, ""b"")", invocation.ToString());
Semantics\PatternMatchingTests2.cs (17)
2021Assert.Equal("return obj is global::Class1 @class && this.i == @class.i;", returnStatement.ToString());
2023Assert.Equal("return obj is Class1 @class && this.i == @class.i;", modifiedReturnStatement.ToString());
2062Assert.Equal("return obj is global::Class1 @class;", returnStatement.ToString());
2064Assert.Equal("return obj is Class1 @class;", modifiedReturnStatement.ToString());
2164Assert.Equal(ex.Source, pat.ToString());
2254Assert.Equal("T2 (var t3, t4: T4 t4) { V5 : T6 t5 }", patterns[0].ToString());
2259Assert.Equal("var t3", patterns[1].ToString());
2264Assert.Equal("T4 t4", patterns[2].ToString());
2269Assert.Equal("T6 t5", patterns[3].ToString());
2298Assert.Equal("Point(3, 4.0)", patterns[0].ToString());
2303Assert.Equal("3", patterns[1].ToString());
2308Assert.Equal("4.0", patterns[2].ToString());
2344Assert.Equal("Point(3, 4.0) { Missing: Xyzzy }", patterns[0].ToString());
2349Assert.Equal("3", patterns[1].ToString());
2355Assert.Equal("4.0", patterns[2].ToString());
2361Assert.Equal("Xyzzy", patterns[3].ToString());
2368Assert.Equal("Q7 t", patterns[4].ToString());
Semantics\PatternMatchingTests3.cs (53)
4116Assert.Equal("((N, N))", pattern.ToString());
4122Assert.Equal("(N, N)", pattern.ToString());
4129Assert.Equal("N", pattern.ToString());
4138Assert.Equal("(((long), (long)))", pattern.ToString());
4144Assert.Equal("((long), (long))", pattern.ToString());
4151Assert.Equal("(long)", pattern.ToString());
4158Assert.Equal("long", pattern.ToString());
4165Assert.Equal("(int, int)", pattern.ToString());
4173Assert.Equal("int", pattern.ToString());
4180Assert.Equal("(System.Int64, System.Int32)", pattern.ToString());
4186Assert.Equal("System.Int64", pattern.ToString());
4193Assert.Equal("System.Int32", pattern.ToString());
4200Assert.Equal("(>= A and <= Z) or (>= a and <= z)", pattern.ToString());
4206Assert.Equal("(>= A and <= Z)", pattern.ToString());
4212Assert.Equal(">= A and <= Z", pattern.ToString());
4218Assert.Equal(">= A", pattern.ToString());
4225Assert.Equal("<= Z", pattern.ToString());
4232Assert.Equal("(>= a and <= z)", pattern.ToString());
4238Assert.Equal(">= a and <= z", pattern.ToString());
4244Assert.Equal(">= a", pattern.ToString());
4251Assert.Equal("<= z", pattern.ToString());
4258Assert.Equal("not (> c0 and < c9)", pattern.ToString());
4264Assert.Equal("(> c0 and < c9)", pattern.ToString());
4270Assert.Equal("> c0 and < c9", pattern.ToString());
4276Assert.Equal("> c0", pattern.ToString());
4283Assert.Equal("< c9", pattern.ToString());
4343Assert.Equal("((N, N))", pattern.ToString());
4349Assert.Equal("(N, N)", pattern.ToString());
4356Assert.Equal("N", pattern.ToString());
4365Assert.Equal("(((long), (long)))", pattern.ToString());
4371Assert.Equal("((long), (long))", pattern.ToString());
4378Assert.Equal("(long)", pattern.ToString());
4385Assert.Equal("long", pattern.ToString());
4392Assert.Equal("((N))", pattern.ToString());
4400Assert.Equal("(int, int)", pattern.ToString());
4407Assert.Equal("int", pattern.ToString());
4414Assert.Equal("(System.Int64, System.Int32)", pattern.ToString());
4420Assert.Equal("System.Int64", pattern.ToString());
4427Assert.Equal("System.Int32", pattern.ToString());
4434Assert.Equal("(>= A and <= Z) or (>= a and <= z)", pattern.ToString());
4440Assert.Equal("(>= A and <= Z)", pattern.ToString());
4446Assert.Equal(">= A and <= Z", pattern.ToString());
4452Assert.Equal(">= A", pattern.ToString());
4459Assert.Equal("<= Z", pattern.ToString());
4466Assert.Equal("(>= a and <= z)", pattern.ToString());
4472Assert.Equal(">= a and <= z", pattern.ToString());
4478Assert.Equal(">= a", pattern.ToString());
4485Assert.Equal("<= z", pattern.ToString());
4492Assert.Equal("not (> c0 and < c9)", pattern.ToString());
4498Assert.Equal("(> c0 and < c9)", pattern.ToString());
4504Assert.Equal("> c0 and < c9", pattern.ToString());
4510Assert.Equal("> c0", pattern.ToString());
4517Assert.Equal("< c9", pattern.ToString());
Semantics\PrimaryConstructorTests.cs (82)
422Assert.Equal("int x", parameters[0].ToString());
425Assert.Equal("string y", parameters[1].ToString());
1008Assert.Equal("= X", x.Parent.ToString());
1073Assert.Equal("Base(X, Y)", x.Parent.Parent.Parent.ToString());
1086Assert.Equal("Base(X, Y)", baseWithargs.ToString());
1186Assert.Equal("= 123", equalsValue.ToString());
1195Assert.Equal(": this(X, Y)", baseWithargs.ToString());
1222Assert.Equal("= 124", equalsValue.ToString());
1301Assert.Equal("Test(X, out var y)", x.Parent.Parent.Parent.ToString());
1312Assert.Equal("y", y.Parent.ToString());
1313Assert.Equal("(Test(X, out var y), y)", y.Parent.Parent.ToString());
1314Assert.Equal("Base(Test(X, out var y), y)", y.Parent.Parent.Parent.ToString());
1325Assert.Equal("(Test(X, out var y), y)", test.Parent.Parent.Parent.ToString());
1366Assert.Equal("Base(X, Y)", x.Parent.Parent.Parent.ToString());
1412Assert.Equal("Base(X, Y)", x.Parent.Parent.Parent.ToString());
1472Assert.Equal("Base(X, Y)", x.Parent.Parent.Parent.ToString());
1530Assert.Equal("Base(X, Y)", x.Parent.Parent.Parent.ToString());
1541Assert.Equal("Base(X, Y)", x.Parent.Parent.Parent.ToString());
1619Assert.Equal("Base(X, Y)", x.Parent.Parent.Parent.ToString());
1630Assert.Equal("Base(X, Y)", x.Parent.Parent.Parent.ToString());
1815Assert.Equal("Base(X)", x.Parent.Parent.Parent.ToString());
1855Assert.Equal("Base(X)", x.Parent.Parent.Parent.ToString());
1898Assert.Equal("Base(X)", x.Parent.Parent.Parent.ToString());
1968Assert.Equal("Base(X, Y)", x.Parent.Parent.Parent.ToString());
2119Assert.Equal("Base(GetInt(X, out var xx) + xx, Y)", baseWithargs.ToString());
2222Assert.Equal(": this(X, Y, Z, 1)", baseWithargs.ToString());
2301Assert.Equal("Base(GetInt(X, out var xx) + xx, Y)", baseWithargs.ToString());
2361Assert.Equal(": base(X, Y, Z, 1)", baseWithargs.ToString());
2426Assert.Equal("Base(X)", x.Parent.Parent.Parent.ToString());
2475Assert.Equal("Error1(0, 1)", baseWithargs.ToString());
2479Assert.Equal("Error1(0)", speculativeBase.ToString());
2485Assert.Equal("Error2()", baseWithoutargs.ToString());
2490Assert.Equal("Error3", baseWithoutParens.ToString());
2642Assert.Equal("= X + 1", x.Parent.Parent.ToString());
2680Assert.Equal("= X + 1", x.Parent.Parent.ToString());
2717Assert.Equal("= X + 1", x.Parent.Parent.ToString());
2753Assert.Equal("() => X + 1", x.Parent.Parent.ToString());
3770switch (literal.ToString())
3809switch (equalsValue.ToString())
3835switch (initializer.ToString())
3859switch (baseType.ToString())
3914switch (identifier.Parent.ToString())
3949switch (baseType.ToString())
3993switch (parameterList.ToString())
4019switch (argumentList.ToString())
4386switch (context.Operation.Syntax.ToString())
4432switch (context.Operation.Syntax.ToString())
4516Assert.Equal("= 0", context.OperationBlocks[0].Syntax.ToString());
4519Assert.Equal("Attr1(100)", context.OperationBlocks[1].Syntax.ToString());
4527Assert.Equal("= 1", context.OperationBlocks[0].Syntax.ToString());
4530Assert.Equal("Attr2(200)", context.OperationBlocks[1].Syntax.ToString());
4533Assert.Equal("A(2)", context.OperationBlocks[2].Syntax.ToString());
4541Assert.Equal("= 4", context.OperationBlocks[0].Syntax.ToString());
4544Assert.Equal("Attr3(300)", context.OperationBlocks[1].Syntax.ToString());
4549Assert.Equal(": base(5)", context.OperationBlocks[3].Syntax.ToString());
4650Assert.Equal("= 0", context.OperationBlocks[0].Syntax.ToString());
4653Assert.Equal("Attr1(100)", context.OperationBlocks[1].Syntax.ToString());
4663Assert.Equal("= 1", context.OperationBlocks[0].Syntax.ToString());
4666Assert.Equal("Attr2(200)", context.OperationBlocks[1].Syntax.ToString());
4669Assert.Equal("A(2)", context.OperationBlocks[2].Syntax.ToString());
4679Assert.Equal("= 4", context.OperationBlocks[0].Syntax.ToString());
4682Assert.Equal("Attr3(300)", context.OperationBlocks[1].Syntax.ToString());
4687Assert.Equal(": base(5)", context.OperationBlocks[3].Syntax.ToString());
4724Assert.Equal("= 0", context.OperationBlocks[0].Syntax.ToString());
4727Assert.Equal("Attr1(100)", context.OperationBlocks[1].Syntax.ToString());
4735Assert.Equal("= 1", context.OperationBlocks[0].Syntax.ToString());
4738Assert.Equal("Attr2(200)", context.OperationBlocks[1].Syntax.ToString());
4741Assert.Equal("A(2)", context.OperationBlocks[2].Syntax.ToString());
4749Assert.Equal("= 4", context.OperationBlocks[0].Syntax.ToString());
4752Assert.Equal("Attr3(300)", context.OperationBlocks[1].Syntax.ToString());
4757Assert.Equal(": base(5)", context.OperationBlocks[3].Syntax.ToString());
5272switch (literal.ToString())
5298switch (equalsValue.ToString())
5316switch (initializer.ToString())
5376switch (baseType.ToString())
5403switch (parameterList.ToString())
5425switch (argumentList.ToString())
5713switch (context.Operation.Syntax.ToString())
5731switch (context.Operation.Syntax.ToString())
5791Assert.Equal("= 0", context.OperationBlocks[0].Syntax.ToString());
5794Assert.Equal("Attr1(100)", context.OperationBlocks[1].Syntax.ToString());
19785Assert.Equal("c[2]", indexer.ToString());
Semantics\RecordTests.cs (67)
2490Assert.Equal("X", x.ToString());
8610var xId = withExpr.DescendantNodes().Single(id => id.ToString() == "X");
21190Assert.Equal("Base(X, Y)", x.Parent!.Parent!.Parent!.ToString());
21203Assert.Equal("Base(X, Y)", baseWithargs.ToString());
21304Assert.Equal("= 123", equalsValue.ToString());
21314Assert.Equal(": this(X, Y)", baseWithargs.ToString());
21341Assert.Equal("= 124", equalsValue.ToString());
21420Assert.Equal("Test(X, out var y)", x.Parent!.Parent!.Parent!.ToString());
21431Assert.Equal("y", y.Parent!.ToString());
21432Assert.Equal("(Test(X, out var y), y)", y.Parent!.Parent!.ToString());
21433Assert.Equal("Base(Test(X, out var y), y)", y.Parent!.Parent!.Parent!.ToString());
21444Assert.Equal("(Test(X, out var y), y)", test.Parent!.Parent!.Parent!.ToString());
21485Assert.Equal("Base(X, Y)", x.Parent!.Parent!.Parent!.ToString());
21531Assert.Equal("Base(X, Y)", x.Parent!.Parent!.Parent!.ToString());
21591Assert.Equal("Base(X, Y)", x.Parent!.Parent!.Parent!.ToString());
21649Assert.Equal("Base(X, Y)", x.Parent!.Parent!.Parent!.ToString());
21660Assert.Equal("Base(X, Y)", x.Parent!.Parent!.Parent!.ToString());
21738Assert.Equal("Base(X, Y)", x.Parent!.Parent!.Parent!.ToString());
21749Assert.Equal("Base(X, Y)", x.Parent!.Parent!.Parent!.ToString());
21934Assert.Equal("Base(X)", x.Parent!.Parent!.Parent!.ToString());
21971Assert.Equal("Base(X)", x.Parent!.Parent!.Parent!.ToString());
22011Assert.Equal("Base(X)", x.Parent!.Parent!.Parent!.ToString());
22046Assert.Equal("Base(X)", x.Parent!.Parent!.Parent!.ToString());
22125Assert.Equal("Base(X, Y)", x.Parent!.Parent!.Parent!.ToString());
22276Assert.Equal("Base(GetInt(X, out var xx) + xx, Y)", baseWithargs.ToString());
22379Assert.Equal(": this(X, Y, Z, 1)", baseWithargs.ToString());
22458Assert.Equal("Base(GetInt(X, out var xx) + xx, Y)", baseWithargs.ToString());
22518Assert.Equal(": base(X, Y, Z, 1)", baseWithargs.ToString());
24689Assert.Equal("= X + 1", x.Parent!.Parent!.ToString());
24724Assert.Equal("= X + 1", x.Parent!.Parent!.ToString());
24758Assert.Equal("= X + 1", x.Parent!.Parent!.ToString());
24793Assert.Equal("() => X + 1", x.Parent!.Parent!.ToString());
26255switch (literal.ToString())
26294switch (equalsValue.ToString())
26320switch (initializer.ToString())
26344switch (baseType.ToString())
26395switch (identifier.Parent!.ToString())
26430switch (baseType.ToString())
26474switch (parameterList.ToString())
26500switch (argumentList.ToString())
26894switch (context.Operation.Syntax.ToString())
26940switch (context.Operation.Syntax.ToString())
27024Assert.Equal("= 0", context.OperationBlocks[0].Syntax.ToString());
27027Assert.Equal("Attr1(100)", context.OperationBlocks[1].Syntax.ToString());
27035Assert.Equal("= 1", context.OperationBlocks[0].Syntax.ToString());
27038Assert.Equal("Attr2(200)", context.OperationBlocks[1].Syntax.ToString());
27041Assert.Equal("A(2)", context.OperationBlocks[2].Syntax.ToString());
27049Assert.Equal("= 4", context.OperationBlocks[0].Syntax.ToString());
27052Assert.Equal("Attr3(300)", context.OperationBlocks[1].Syntax.ToString());
27057Assert.Equal(": base(5)", context.OperationBlocks[3].Syntax.ToString());
27158Assert.Equal("= 0", context.OperationBlocks[0].Syntax.ToString());
27161Assert.Equal("Attr1(100)", context.OperationBlocks[1].Syntax.ToString());
27171Assert.Equal("= 1", context.OperationBlocks[0].Syntax.ToString());
27174Assert.Equal("Attr2(200)", context.OperationBlocks[1].Syntax.ToString());
27177Assert.Equal("A(2)", context.OperationBlocks[2].Syntax.ToString());
27187Assert.Equal("= 4", context.OperationBlocks[0].Syntax.ToString());
27190Assert.Equal("Attr3(300)", context.OperationBlocks[1].Syntax.ToString());
27195Assert.Equal(": base(5)", context.OperationBlocks[3].Syntax.ToString());
27232Assert.Equal("= 0", context.OperationBlocks[0].Syntax.ToString());
27235Assert.Equal("Attr1(100)", context.OperationBlocks[1].Syntax.ToString());
27243Assert.Equal("= 1", context.OperationBlocks[0].Syntax.ToString());
27246Assert.Equal("Attr2(200)", context.OperationBlocks[1].Syntax.ToString());
27249Assert.Equal("A(2)", context.OperationBlocks[2].Syntax.ToString());
27257Assert.Equal("= 4", context.OperationBlocks[0].Syntax.ToString());
27260Assert.Equal("Attr3(300)", context.OperationBlocks[1].Syntax.ToString());
27265Assert.Equal(": base(5)", context.OperationBlocks[3].Syntax.ToString());
28390Assert.Equal("I1", cref.ToString());
Microsoft.CodeAnalysis.CSharp.Features (20)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (6)
IOperation\IOperationTests.cs (4)
464Assert.Equal("(x, y, z) = (1, 2, 3)", assignments[0].ToString());
470Assert.Equal("(x, y, z) = new C()", assignments[1].ToString());
476Assert.Equal("var (a, b) = (1, 2)", assignments[2].ToString());
559Assert.Equal("a.b", expr.ToString());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (523)
Semantics\BindingTests.cs (24)
2728Assert.Equal("A.B<string>.M0", identifierNameM0.Parent.ToString());
2740Assert.Equal("A.B<string>.M1", identifierNameM1.Parent.ToString());
2786Assert.Equal("(MyDelegate<int>)MyMethod", identifiers[0].Parent.ToString());
2789Assert.Equal("(MyDelegate<long>)MyMethod", identifiers[1].Parent.ToString());
2792Assert.Equal("(MyDelegate<float>)MyMethod", identifiers[2].Parent.ToString());
2795Assert.Equal("(MyDelegate<double>)MyMethod", identifiers[3].Parent.ToString());
2839Assert.Equal("b.M0", identifierNameM0.Parent.ToString());
2851Assert.Equal("b.M1", identifierNameM1.Parent.ToString());
3038Assert.Equal("app.Use", node1.ToString());
3053Assert.Equal("ctx.Authentication.AuthenticateAsync", node.ToString());
3118Assert.Equal("app.Use", node1.ToString());
3133Assert.Equal("ctx.Authentication.AuthenticateAsync", node.ToString());
3191Assert.Equal("app.Use", node1.ToString());
3207Assert.Equal("ctx.Authentication.AuthenticateAsync", node.ToString());
3276Assert.Equal("app.Use", node1.ToString());
3292Assert.Equal("ctx.Authentication.AuthenticateAsync", node.ToString());
3381Assert.Equal("MathMin(0, 1)", node1.ToString());
3733Assert.Equal("x.E1.E", node1.ToString());
3737Assert.Equal("x.E1", node2.ToString());
3912var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "G").First();
3989Assert.Equal("b", id.ToString());
3994Assert.Equal("a", id.ToString());
4030Assert.Equal("b", id.ToString());
4035Assert.Equal("a", id.ToString());
Semantics\ColorColorTests.cs (14)
1818Assert.Equal("Lifetime", memberAccess.Expression.ToString());
1819Assert.Equal("Lifetime.Persistent", memberAccess.ToString());
1883Assert.Equal("E.A", node1.ToString());
1884Assert.Equal("E", node1.Expression.ToString());
1894Assert.Equal("= E", node2.Parent.ToString());
1940Assert.Equal("E.A", node1.ToString());
1941Assert.Equal("E", node1.Expression.ToString());
1951Assert.Equal("= E", node2.Parent.ToString());
1997Assert.Equal("E.A", node1.ToString());
1998Assert.Equal("E", node1.Expression.ToString());
2008Assert.Equal("= E", node2.Parent.ToString());
2047Assert.Equal("E.A", node1.ToString());
2048Assert.Equal("E", node1.Expression.ToString());
2057Assert.Equal("= E", node2.Parent.ToString());
Semantics\DeconstructionTests.cs (45)
4259Assert.Equal("var (a,b)", declarations[0].ToString());
4282Assert.Equal("var c", declarations[1].ToString());
4300Assert.Equal("int d", declarations[2].ToString());
4394Assert.Equal("var (a,b)", declarations[0].ToString());
4413Assert.Equal("var c", declarations[1].ToString());
4431Assert.Equal("int d", declarations[2].ToString());
4518Assert.Equal("var (_, _)", declarations[0].ToString());
4541Assert.Equal("var _", declarations[1].ToString());
4562Assert.Equal("int _", declarations[2].ToString());
4668Assert.Equal("var (a,b)", declarations[0].ToString());
4687Assert.Equal("var c", declarations[1].ToString());
4725Assert.Equal("var (a, a)", aa.ToString());
4762Assert.Equal("var (a,b)", declarations[0].ToString());
4781Assert.Equal("var c", declarations[1].ToString());
4840Assert.Equal("var (_, _)", declarations[0].ToString());
4859Assert.Equal("var _", declarations[1].ToString());
4944Assert.Equal("al c", declaration.ToString());
4990Assert.Equal("al c", declaration.ToString());
5048Assert.Equal("al _", declaration.ToString());
5208Assert.Equal("var (a,b)", declarations[0].ToString());
5227Assert.Equal("var c", declarations[1].ToString());
5245Assert.Equal("int d", declarations[2].ToString());
5262Assert.Equal("((var (a,b), var c), int d)", tuples[0].ToString());
5272Assert.Equal("(var (a,b), var c)", tuples[1].ToString());
5352Assert.Equal("var (a,b)", declarations[0].ToString());
5371Assert.Equal("var c", declarations[1].ToString());
5389Assert.Equal("int d", declarations[2].ToString());
5406Assert.Equal("((var (a,b), var c), int d)", tuples[0].ToString());
5416Assert.Equal("(var (a,b), var c)", tuples[1].ToString());
5489Assert.Equal("var (_, _)", declarations[0].ToString());
5508Assert.Equal("var _", declarations[1].ToString());
5529Assert.Equal("int _", declarations[2].ToString());
5549Assert.Equal("((var (_, _), var _), int _)", tuples[0].ToString());
5559Assert.Equal("(var (_, _), var _)", tuples[1].ToString());
5676Assert.Equal("var ((a,b), c)", declarations[0].ToString());
5695Assert.Equal("int d", declarations[1].ToString());
5786Assert.Equal("var ((a,b), c)", declarations[0].ToString());
5805Assert.Equal("int d", declarations[1].ToString());
5889Assert.Equal("var ((_, _), _)", declarations[0].ToString());
5908Assert.Equal("int _", declarations[1].ToString());
5986var mainCall = tree.GetRoot().DescendantNodes().OfType<ExpressionSyntax>().Where(n => n.ToString() == "Main()").Single();
6029var mainCall = tree.GetRoot().DescendantNodes().OfType<ExpressionSyntax>().Where(n => n.ToString() == "Main()").Single();
6069var mainCall = tree.GetRoot().DescendantNodes().OfType<ExpressionSyntax>().Where(n => n.ToString() == "Main()").Single();
6111var two = tree.GetRoot().DescendantNodes().OfType<ExpressionSyntax>().Where(n => n.ToString() == "2").Single();
6151var mainCall = tree.GetRoot().DescendantNodes().OfType<ExpressionSyntax>().Where(n => n.ToString() == "Main()").Single();
Semantics\DynamicTests.cs (18)
4986AssertEx.Equal(@"i1.Test(""name"", value)", call.ToString());
5110AssertEx.Equal(@"i1.Test(""name"", value)", call.ToString());
5233AssertEx.Equal(@"i1.Test(""name"", value)", call.ToString());
5347AssertEx.Equal(@"new C().Test(""name"", d)", call.ToString());
5388AssertEx.Equal(@"Test(name: ""name"", d)", call.ToString());
5432AssertEx.Equal(@"Test(&name, d)", call.ToString());
5476AssertEx.Equal(@"Test(""name"", d)", call.ToString());
5520AssertEx.Equal(@"Test(""name"", d)", call.ToString());
5697AssertEx.Equal(@"i1(""name"", value)", call.ToString());
5738AssertEx.Equal(@"Test(name: ""name"", d)", call.ToString());
5783AssertEx.Equal(@"Test(&name, d)", call.ToString());
5828AssertEx.Equal(@"Test(""name"", d)", call.ToString());
5873AssertEx.Equal(@"Test(""name"", d)", call.ToString());
11327AssertEx.Equal(@"i1.Test(""name"", value)", call.ToString());
11380AssertEx.Equal(@"i1.Test(""name"", value)", call.ToString());
11456AssertEx.Equal(@"Test(""name"", d)", call.ToString());
11500AssertEx.Equal(@"i1(""name"", value)", call.ToString());
11541AssertEx.Equal(@"Test(""name"", d)", call.ToString());
Semantics\ExpressionBodiedMemberTests.cs (16)
477Assert.Equal("P1", node.ToString());
508Assert.Equal("P1", node.ToString());
537Assert.Equal("P1", node.ToString());
546Assert.Equal("P1", node2.ToString());
577Assert.Equal("P1", node.ToString());
586Assert.Equal("P1", node2.ToString());
651Assert.Equal("P1", node.ToString());
682Assert.Equal("P1", node.ToString());
713Assert.Equal("P1", node.ToString());
744Assert.Equal("P1", node.ToString());
779Assert.Equal("P1", node.ToString());
810Assert.Equal("P1", node.ToString());
845Assert.Equal("P1", node.ToString());
880Assert.Equal("P1", node.ToString());
919Assert.Equal("P1", node.ToString());
1026Assert.Equal($"{i}", nodes[i].ToString());
Semantics\GlobalUsingDirectiveTests.cs (38)
3853Assert.Equal("global using alias1 = C1;", aliases[0].ToString());
3856Assert.Equal("global using alias1 = C2;", aliases[1].ToString());
3859Assert.Equal("using alias1 = C3;", aliases[2].ToString());
3862Assert.Equal("using alias1 = C4;", aliases[3].ToString());
3879Assert.Equal("global using alias1 = C1;", aliases[0].ToString());
3882Assert.Equal("using alias1 = C3;", aliases[1].ToString());
3885Assert.Equal("using alias1 = C4;", aliases[2].ToString());
3893Assert.Equal("global using alias1 = C2;", aliases[0].ToString());
3910Assert.Equal("using alias1 = C3;", aliases[0].ToString());
3913Assert.Equal("using alias1 = C4;", aliases[1].ToString());
3921Assert.Equal("global using alias1 = C1;", aliases[0].ToString());
3924Assert.Equal("global using alias1 = C2;", aliases[1].ToString());
3943Assert.Equal("global using alias1 = C1;", aliases[0].ToString());
3946Assert.Equal("global using alias1 = C2;", aliases[1].ToString());
3963Assert.Equal("global using alias1 = C1;", aliases[0].ToString());
3971Assert.Equal("global using alias1 = C2;", aliases[0].ToString());
3993Assert.Equal("global using alias1 = C1;", aliases[0].ToString());
3996Assert.Equal("global using alias1 = C2;", aliases[1].ToString());
4009Assert.Equal("global using alias1 = C1;", aliases[0].ToString());
4012Assert.Equal("global using alias1 = C2;", aliases[1].ToString());
4015Assert.Equal("using alias1 = C3;", aliases[2].ToString());
4018Assert.Equal("using alias1 = C4;", aliases[3].ToString());
4029Assert.Equal("global using alias1 = C1;", aliases[0].ToString());
4032Assert.Equal("using alias1 = C3;", aliases[1].ToString());
4035Assert.Equal("using alias1 = C4;", aliases[2].ToString());
4043Assert.Equal("global using alias1 = C2;", aliases[0].ToString());
4054Assert.Equal("using alias1 = C3;", aliases[0].ToString());
4057Assert.Equal("using alias1 = C4;", aliases[1].ToString());
4065Assert.Equal("global using alias1 = C1;", aliases[0].ToString());
4068Assert.Equal("global using alias1 = C2;", aliases[1].ToString());
4081Assert.Equal("global using alias1 = C1;", aliases[0].ToString());
4084Assert.Equal("global using alias1 = C2;", aliases[1].ToString());
4095Assert.Equal("global using alias1 = C1;", aliases[0].ToString());
4103Assert.Equal("global using alias1 = C2;", aliases[0].ToString());
4122Assert.Equal("using alias1 = C3;", aliases[0].ToString());
4125Assert.Equal("using alias1 = C4;", aliases[1].ToString());
4154Assert.Equal("using alias1 = C3;", aliases[0].ToString());
4157Assert.Equal("using alias1 = C4;", aliases[1].ToString());
Semantics\ImplicitObjectCreationTests.cs (12)
1714Assert.Equal(expression, invocation.ToString());
1981Assert.Equal("new(x)", def.ToString());
2039Assert.Equal("new()", @new.ToString());
2046Assert.Equal("new object()", newObject.ToString());
2074Assert.Equal("new()", @new.ToString());
2081Assert.Equal("new object()", newObject.ToString());
2220Assert.Equal("new()", def.ToString());
2568Assert.Equal("new()", def.ToString());
3218Assert.Equal("(o, new())", first.Parent.Parent.ToString());
3222Assert.Equal("(new(), o)", second.Parent.Parent.ToString());
3226Assert.Equal("(c, new())", third.Parent.Parent.ToString());
3230Assert.Equal("(new(), c)", fourth.Parent.Parent.ToString());
Semantics\LambdaTests.cs (32)
1515Assert.Equal("a.", node.Parent.ToString().Trim());
1550Assert.Equal("a.", node.Parent.ToString().Trim());
1584Assert.Equal("a.", node.Parent.ToString().Trim());
1616Assert.Equal("a.", node.Parent.ToString().Trim());
1981Assert.Equal("async delegate { await Task.Delay(0); }", node1.ToString());
2122Assert.Equal("e", eReference.ToString());
2168Assert.Equal("x", eReference.ToString());
2214Assert.Equal("x", eReference.ToString());
2260Assert.Equal("x", eReference.ToString());
2306Assert.Equal("x", eReference.ToString());
2336Assert.Equal("c", eReference.ToString());
2363Assert.Equal("a", eReference.ToString());
2418Assert.Equal("x", reference.ToString());
2464Assert.Equal("x", reference.ToString());
2510Assert.Equal("x", reference.ToString());
2543Assert.Equal("x", reference.ToString());
2576Assert.Equal("x", reference.ToString());
2613Assert.Equal("x", reference.ToString());
3000Assert.Equal("ContentType", contentType.ToString());
3007Assert.Equal("b", b.ToString());
3042Assert.Equal("ContentType", contentType.ToString());
3049Assert.Equal("b", b.ToString());
7110Assert.Equal("r1 => r1", lambdas[0].ToString());
7115Assert.Equal("r2 => r2", lambdas[1].ToString());
8017Assert.Equal("(int a, int b = 1) => a + b", lambdas[0].Node.ToString());
8027Assert.Equal("([Optional] int x) => x", lambdas[1].Node.ToString());
8034Assert.Equal("([DefaultParameterValue(2)] int x) => x", lambdas[2].Node.ToString());
8041Assert.Equal("([Optional, DefaultParameterValue(3)] int x) => x", lambdas[3].Node.ToString());
8060Assert.Equal("= 1", equalsValue.ToString());
8121Assert.Equal("const int N = 10;", decls[0].ToString());
8125Assert.Equal("var lam = (int a = N) => a;", decls[1].ToString());
8131Assert.Equal("var x = N;", decls[2].ToString());
Semantics\NonTrailingNamedArgumentsTests.cs (18)
47Assert.Equal("M(a: 1, 2)", firstInvocation.ToString());
52Assert.Equal("a: 1", firstNamedArgA.Parent.ToString());
59Assert.Equal("M(3, a: 4)", secondInvocation.ToString());
64Assert.Equal("a: 4", secondNamedArgA.Parent.ToString());
369Assert.Equal("M(1, first: 2)", invocation.ToString());
395Assert.Equal(@"C.M(a: 1, ""hi"")", invocation.ToString());
425Assert.Equal("M(c: 1, 2)", invocation.ToString());
457Assert.Equal("M(x: 1, 2)", invocation.ToString());
486Assert.Equal("M(1, x: 2)", invocation.ToString());
536Assert.Equal("M(x: 1, x: 2)", invocation.ToString());
571Assert.Equal("M(x: 1, x: 2, 3)", invocation.ToString());
600Assert.Equal("M(y: 1, 2)", invocation.ToString());
654Assert.Equal("M(x: 1, 2)", invocation.ToString());
681Assert.Equal("M(y: 1, x: 2)", invocation.ToString());
712Assert.Equal("M(c: valueC, valueB)", firstInvocation.ToString());
746Assert.Equal("M(c: valueC, valueB)", invocation.ToString());
778Assert.Equal("M(c: valueC, valueB)", invocation.ToString());
985Assert.Equal("MyAttribute(condition: true, 42)", invocation.ToString());
Semantics\NullableReferenceTypesTests.cs (60)
1755Assert.Equal(@"$""hello ""!", suppression.ToString());
1759Assert.Equal(@"$""hello """, interpolated.ToString());
1790Assert.Equal(@"$""hello ""!", suppression.ToString());
1794Assert.Equal(@"$""hello """, interpolated.ToString());
1964Assert.Equal("M2!", suppression.ToString());
2277Assert.Equal("(string? x) => { return null; }!", suppression.ToString());
2281Assert.Equal("(string? x) => { return null; }", lambda.ToString());
2316Assert.Equal("(string? x) => { return null; }!", suppression.ToString());
2320Assert.Equal("(string? x) => { return null; }", lambda.ToString());
2348Assert.Equal("(string x) => { return string.Empty; }!", suppression.ToString());
2353Assert.Equal("(string x) => { return string.Empty; }", lambda.ToString());
2382Assert.Equal("(string x) => { return string.Empty; }!", suppression.ToString());
2386Assert.Equal("(string x) => { return string.Empty; }", lambda.ToString());
2480Assert.Equal(@"(string? x) => { return null; }!", suppression.ToString());
3337Assert.Equal("x", reference.ToString());
7770Assert.Equal("[]", specifier.ToString());
7777Assert.Equal("[3]", newSpecifier.ToString());
10537Assert.Equal("string", type1.ToString());
10541Assert.Equal("string?", type2.ToString());
56077Assert.Equal("null", nullNode.ToString());
56107Assert.Equal("null", nullNode.ToString());
56140Assert.Equal("default", defaultNode.ToString());
56177Assert.Equal("default", defaultNode.ToString());
56305Assert.Equal("null", nullNode.ToString());
56438Assert.Equal("new()", newNode.ToString());
56473Assert.Equal("new(null)", newNode.ToString());
56509Assert.Equal("null", nullNode.ToString());
56620Assert.Equal("() => { }", lambdaNode.ToString());
65901Assert.Equal("object?", object2.Parent.ToString());
71877Assert.Equal("var _", discard1.ToString());
71882Assert.Equal("_", discard2.ToString());
71887Assert.Equal("var _", discard3.ToString());
71892Assert.Equal("_", discard4.ToString());
71925Assert.Equal("var _", discard1.ToString());
71935Assert.Equal("_", discard2.ToString());
71963Assert.Equal("_", discardPattern1.ToString());
71970Assert.Equal("_", discardPattern2.ToString());
145383Assert.Equal("c.Extension()", invocation.ToString());
145502Assert.Equal("c.Extension()", invocation.ToString());
145540Assert.Equal("c.Extension()", invocation.ToString());
145573Assert.Equal("c.Extension()", invocation.ToString());
145606Assert.Equal("c.Extension()", invocation.ToString());
155997var identifiers = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "global::Program").ToArray();
157582Assert.Equal("field", declarators[0].Value.ToString());
157584Assert.Equal("C<T>.field", declarators[1].Value.ToString());
157586Assert.Equal("C<T>.field", declarators[2].Value.ToString());
157632Assert.Equal("M<T>(out x)", invocations[0].ToString());
157635Assert.Equal("M<T>(out x)", invocations[1].ToString());
158062Assert.Equal("i.Item", item.ToString());
158098Assert.Equal("i[0]", item.ToString());
158193Assert.Equal("i.Get()", item.ToString());
158231Assert.Equal("i.Item", item.ToString());
158383Assert.Equal("i[0]", item.ToString());
158478Assert.Equal("i.Get()", item.ToString());
161247Assert.Equal("s", identifiers[0].ToString());
161248Assert.Equal("Length", identifiers[1].ToString());
161249Assert.Equal("s", identifiers[2].ToString());
161293Assert.Equal("s", identifiers[0].ToString());
161294Assert.Equal("Length", identifiers[1].ToString());
161295Assert.Equal("s", identifiers[2].ToString());
Semantics\RecordStructTests.cs (22)
2595Assert.Equal("= X + 1", x.Parent!.Parent!.ToString());
2630Assert.Equal("= X + 1", x.Parent!.Parent!.ToString());
2664Assert.Equal("= X + 1", x.Parent!.Parent!.ToString());
2699Assert.Equal("() => X + 1", x.Parent!.Parent!.ToString());
3286Assert.Equal("I1", cref.ToString());
3334Assert.Equal("I2", cref.ToString());
3385Assert.Equal("I2", cref.ToString());
5971switch (literal.ToString())
5997switch (equalsValue.ToString())
6015switch (initializer.ToString())
6075switch (baseType.ToString())
6102switch (parameterList.ToString())
6124switch (argumentList.ToString())
6439switch (context.Operation.Syntax.ToString())
6457switch (context.Operation.Syntax.ToString())
6517Assert.Equal("= 0", context.OperationBlocks[0].Syntax.ToString());
6520Assert.Equal("Attr1(100)", context.OperationBlocks[1].Syntax.ToString());
10651AssertEx.AssertEqualToleratingWhitespaceDifferences(expected, SyntaxFactory.TypeDeclaration(SyntaxKind.RecordStructDeclaration, "Point").NormalizeWhitespace().ToString());
10773Assert.Equal("Error1(0, 1)", baseWithargs.ToString());
10777Assert.Equal("Error1(0)", speculativeBase.ToString());
10783Assert.Equal("Error2()", baseWithoutargs.ToString());
10788Assert.Equal("Error3", baseWithoutParens.ToString());
Semantics\RefEscapingTests.cs (16)
5785Assert.Equal(@"(local, """")", tuple2.ToString());
5786Assert.Equal(@"(global, s) = (local, """")", tuple2.Parent.ToString());
5791Assert.Equal(@"(local, null)", tuple3.ToString());
5792Assert.Equal(@"(global, s) = (local, null)", tuple3.Parent.ToString());
5797Assert.Equal(@"(local, """")", tuple6.ToString());
5798Assert.Equal(@"(c, s) = (local, """")", tuple6.Parent.ToString());
5803Assert.Equal("(local, null)", tuple7.ToString());
5804Assert.Equal("(c, s) = (local, null)", tuple7.Parent.ToString());
5885Assert.Equal(@"(local, """")", tuple2.ToString());
5886Assert.Equal(@"(global, s) = (local, """")", tuple2.Parent.ToString());
5891Assert.Equal(@"(local, null)", tuple3.ToString());
5892Assert.Equal(@"(global, s) = (local, null)", tuple3.Parent.ToString());
5897Assert.Equal(@"(local, """")", tuple6.ToString());
5898Assert.Equal(@"(c, s) = (local, """")", tuple6.Parent.ToString());
5903Assert.Equal("(local, null)", tuple7.ToString());
5904Assert.Equal("(c, s) = (local, null)", tuple7.Parent.ToString());
Semantics\RefFieldTests.cs (7)
16552Assert.Equal("M2(r => r)", invocations[0].ToString());
16555Assert.Equal("M2((scoped R r) => r)", invocations[1].ToString());
16593Assert.Equal("delegate { }", anonymousMethod.ToString());
16632Assert.Equal("delegate { }", anonymousMethod.ToString());
16728Assert.Equal("(r1, t1) => F((r2, t2) => r2, t1)", lambdas[0].ToString());
16735Assert.Equal("(r2, t2) => r2", lambdas[1].ToString());
16776Assert.Equal("o2 => throw null!", lambda.ToString());
Semantics\ScriptSemanticsTests.cs (13)
1184Assert.Equal("WriteLine", node5.Name.ToString());
1196Assert.Equal("WriteLine", node5.Name.ToString());
1211Assert.Equal("WriteLine", node5.Name.ToString());
1220Assert.Equal("WriteLine", node5.Name.ToString());
1229Assert.Equal("WriteLine", node5.Name.ToString());
1241Assert.Equal("WriteLine", node5.Name.ToString());
1253Assert.Equal("WriteLine", node5.Name.ToString());
1272Assert.Equal("WriteLine", node1.Name.ToString());
1273Assert.Equal("WriteLine", node2.Name.ToString());
1311Assert.Equal("WriteLine", node5.Name.ToString());
1325Assert.Equal("WriteLine", node5.Name.ToString());
1340Assert.Equal("WriteLine", node5.Name.ToString());
1355Assert.Equal("WriteLine", node5.Name.ToString());
Semantics\TargetTypedDefaultTests.cs (36)
197Assert.Equal("default", def.ToString());
245Assert.Equal("default", def.ToString());
254Assert.Equal("null", nullSyntax.ToString());
282Assert.Equal("default", def.ToString());
291Assert.Equal("null", nullSyntax.ToString());
327Assert.Equal("default", default1.ToString());
333Assert.Equal("default", default2.ToString());
521Assert.Equal("default", def.ToString());
530Assert.Equal("null", nullSyntax.ToString());
567Assert.Equal("default", def.ToString());
576Assert.Equal("null", nullSyntax.ToString());
610Assert.Equal("default", def.ToString());
619Assert.Equal("null", nullSyntax.ToString());
668Assert.Equal("default", def.ToString());
749Assert.Equal("default", def.ToString());
758Assert.Equal("null", nullSyntax.ToString());
1143Assert.Equal("default", def.ToString());
1632Assert.Equal("s += default", defaultLiteral.Parent.ToString());
1736var defaults = nodes.OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default");
1740Assert.Equal("default", @default.ToString());
1802var defaults = nodes.OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default");
1806Assert.Equal("default", @default.ToString());
1873var defaults = nodes.OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default");
1877Assert.Equal("default", @default.ToString());
1912Assert.Equal("default", first.ToString());
2090Assert.Equal("default", def.ToString());
2334Assert.Equal("default", def.ToString());
2341Assert.Equal("null", nullSyntax.ToString());
2415Assert.Equal("(o, default)", first.Parent.Parent.ToString());
2420Assert.Equal("(default, o)", second.Parent.Parent.ToString());
2425Assert.Equal("(s, default)", third.Parent.Parent.ToString());
2430Assert.Equal("(default, s)", fourth.Parent.Parent.ToString());
2458Assert.Equal("default", def.ToString());
3345Assert.Equal("default", def.ToString());
3384Assert.Equal("default", def.ToString());
3515Assert.Equal("default", def.ToString());
Semantics\TopLevelStatementsTests.cs (62)
1709Assert.Equal("System.Console.WriteLine(Test)", nameRef.Parent.Parent.Parent.ToString());
1717Assert.Equal("using alias1 = Test;", nameRef.Parent.ToString());
1733Assert.Equal(": Test", nameRef.Parent.Parent.ToString());
1739Assert.Equal("System.Console.WriteLine(Test)", nameRef.Parent.Parent.Parent.ToString());
1744Assert.Equal("using alias2 = Test;", nameRef.Parent.ToString());
1749Assert.Equal(": Test", nameRef.Parent.Parent.ToString());
1755Assert.Equal("System.Console.WriteLine(Test)", nameRef.Parent.Parent.Parent.ToString());
1885Assert.Equal("using alias1 = Test;", nameRef.Parent.ToString());
1901Assert.Equal(": Test", nameRef.Parent.Parent.ToString());
1907Assert.Equal("System.Console.WriteLine(Test)", nameRef.Parent.Parent.Parent.ToString());
1912Assert.Equal("using alias2 = Test;", nameRef.Parent.ToString());
1917Assert.Equal(": Test", nameRef.Parent.Parent.ToString());
1923Assert.Equal("System.Console.WriteLine(Test)", nameRef.Parent.Parent.Parent.ToString());
2103Assert.Equal("using alias1 = Test;", nameRef.Parent.ToString());
2116Assert.Equal(": Test", nameRef.Parent.Parent.ToString());
2121Assert.Equal("System.Console.WriteLine(Test())", nameRef.Parent.Parent.Parent.Parent.ToString());
2126Assert.Equal("using alias2 = Test;", nameRef.Parent.ToString());
2131Assert.Equal(": Test", nameRef.Parent.Parent.ToString());
2136Assert.Equal("System.Console.WriteLine(Test())", nameRef.Parent.Parent.Parent.Parent.ToString());
2269Assert.Equal("using alias1 = Test;", nameRef.Parent.ToString());
2282Assert.Equal(": Test", nameRef.Parent.Parent.ToString());
2287Assert.Equal("System.Console.WriteLine(Test())", nameRef.Parent.Parent.Parent.Parent.ToString());
2292Assert.Equal("using alias2 = Test;", nameRef.Parent.ToString());
2297Assert.Equal(": Test", nameRef.Parent.Parent.ToString());
2302Assert.Equal("System.Console.WriteLine(Test())", nameRef.Parent.Parent.Parent.Parent.ToString());
2449Assert.Equal("using alias1 = Test;", nameRef.Parent.ToString());
2464Assert.Equal("goto Test;", nameRef.Parent.ToString());
2479Assert.Equal(": Test", nameRef.Parent.Parent.ToString());
2484Assert.Equal("goto Test;", nameRef.Parent.ToString());
2489Assert.Equal("using alias2 = Test;", nameRef.Parent.ToString());
2494Assert.Equal(": Test", nameRef.Parent.Parent.ToString());
2500Assert.Equal("goto Test;", nameRef.Parent.ToString());
3944Assert.Equal("using alias1 = args;", nameRef.Parent.ToString());
3956Assert.Equal("System.Console.WriteLine(args)", nameRef.Parent.Parent.Parent.ToString());
3975Assert.Equal(": args", nameRef.Parent.Parent.ToString());
3980Assert.Equal("System.Console.WriteLine(args)", nameRef.Parent.Parent.Parent.ToString());
3985Assert.Equal("using alias2 = args;", nameRef.Parent.ToString());
3990Assert.Equal(": args", nameRef.Parent.Parent.ToString());
3995Assert.Equal("System.Console.WriteLine(args)", nameRef.Parent.Parent.Parent.ToString());
4093Assert.Equal("using alias1 = args;", nameRef.Parent.ToString());
4105Assert.Equal(": args", nameRef.Parent.Parent.ToString());
4110Assert.Equal("System.Console.WriteLine(args)", nameRef.Parent.Parent.Parent.ToString());
4115Assert.Equal("using alias2 = args;", nameRef.Parent.ToString());
4120Assert.Equal(": args", nameRef.Parent.Parent.ToString());
4125Assert.Equal("System.Console.WriteLine(args)", nameRef.Parent.Parent.Parent.ToString());
6441switch (globalStatement.ToString())
6471switch (unit.ToString())
6537switch (context.Symbol.DeclaringSyntaxReferences.Single().GetSyntax().ToString())
6613switch (context.Symbol.DeclaringSyntaxReferences.Single().GetSyntax().ToString())
6637switch (syntaxReference.GetSyntax().ToString())
6656Assert.Equal("System.Console.WriteLine(1);", context.Symbol.DeclaringSyntaxReferences.Single().GetSyntax().ToString());
6663Assert.Equal("System.Console.WriteLine(2);", context.Symbol.DeclaringSyntaxReferences.Single().GetSyntax().ToString());
6725switch (context.Operation.Syntax.ToString())
6745switch (context.Operation.Syntax.ToString())
6803switch (context.OperationBlocks.Single().Syntax.ToString())
6861switch (context.OperationBlocks.Single().Syntax.ToString())
6919switch (context.CodeBlock.ToString())
6987switch (context.CodeBlock.ToString())
7069switch (node.ToString())
7183switch (node.ToString())
7355switch (context.OperationBlocks.Single().Syntax.ToString())
7423switch (context.Operation.Syntax.ToString())
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (125)
Compilation\SemanticModelAPITests.cs (17)
111.Where(e => e.Name.ToString() == "GenericExtension").First();
1200var args = descendants.OfType<ArgumentSyntax>().Where(s => s.ToString() == "index").Select(s => s);
4145Assert.Equal(@"$""Number 3""", actual[0].ToString());
4148Assert.Equal(@"$""{""Level 5""} {S1}""", actual[1].ToString());
4153Assert.Equal(@"$""Testing""", actual[3].ToString());
4156Assert.Equal(@"$""ConstantInterpolatedString""", actual[4].ToString());
4159Assert.Equal(@"$""Level 5""", actual[5].ToString());
4162Assert.Equal(@"$""Radio Noise""", actual[6].ToString());
4165Assert.Equal(@"$""Level 5""", actual[7].ToString());
4278Assert.Equal(@"$""""""Number 3""""""", actual[0].ToString());
4282Assert.Equal(@"$""""""{""""""Level 5""""""} {S1}""""""", actual[1].ToString());
4289Assert.Equal(@"$""""""Testing""""""", actual[3].ToString());
4293Assert.Equal(@"$""""""ConstantInterpolatedString""""""", actual[4].ToString());
4297Assert.Equal(@"$""""""Level 5""""""", actual[5].ToString());
4301Assert.Equal(@"$""""""Radio Noise""""""", actual[6].ToString());
4305Assert.Equal(@"$""""""Level 5""""""", actual[7].ToString());
4778var expr = exprSyn.ToString();
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (12)
4801Assert.Equal("(1, 2)", type.DeclaringSyntaxReferences.Single().GetSyntax().ToString());
4824Assert.Equal("(Alice: 1, Bob: 2)", type.DeclaringSyntaxReferences.Single().GetSyntax().ToString());
4847Assert.Equal("(1, 1)", type.DeclaringSyntaxReferences.Single().GetSyntax().ToString());
4870Assert.Equal("(1, null)", type.DeclaringSyntaxReferences.Single().GetSyntax().ToString());
4893Assert.Equal("(Alice:1, Bob:null)", type.DeclaringSyntaxReferences.Single().GetSyntax().ToString());
4916Assert.Equal("Bob", element.DeclaringSyntaxReferences.Single().GetSyntax().ToString());
4939Assert.Equal("Bob", element.DeclaringSyntaxReferences.Single().GetSyntax().ToString());
4962Assert.Equal("Bob", element.DeclaringSyntaxReferences.Single().GetSyntax().ToString());
4997Assert.Equal("Bob", element.DeclaringSyntaxReferences.Single().GetSyntax().ToString());
5043Assert.Equal("Bob", element.DeclaringSyntaxReferences.Single().GetSyntax().ToString());
5092Assert.Equal("Bob", element.DeclaringSyntaxReferences.Single().GetSyntax().ToString());
5115Assert.Equal("Bob", element.DeclaringSyntaxReferences.Single().GetSyntax().ToString());
Symbols\StaticAbstractMembersInInterfacesTests.cs (38)
8455Assert.Equal("T.M01()", node.ToString());
9043Assert.Equal(prefixOp + "x" + postfixOp, node.ToString());
9358Assert.Equal("x ? true : false", node.ToString());
9757Assert.Equal("x " + op + " x", node.ToString());
10752var node = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + " 1").Single();
10754Assert.Equal("x " + op + " 1", node.ToString());
10945var node = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + " 1").Single();
10947Assert.Equal("x " + op + " 1", node.ToString());
11135var node = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + " y").Single();
11137Assert.Equal("x " + op + " y", node.ToString());
11329var node1 = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + op + " y").First();
11331Assert.Equal("x " + op + op + " y", node1.ToString());
11583var node1 = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + op + " y").First();
11585Assert.Equal("x " + op + op + " y", node1.ToString());
11960var node = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().Where(n => n.ToString() == "x " + op + "= 1").Single();
11962Assert.Equal("x " + op + "= 1", node.ToString());
12141Assert.Equal("x " + op + " x", node.ToString());
13182Assert.Equal("T.P01", node.ToString());
13268Assert.Equal("T.P01", node.ToString());
13390Assert.Equal("T.P01", node.ToString());
14091Assert.Equal("T.E01", node.ToString());
14100Assert.Equal("T.E01", node.ToString());
14716Assert.Equal("T.M01", node.ToString());
15122Assert.Equal("T.M01", node.ToString());
15390Assert.Equal("T.M01", node.ToString());
19560var node = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First();
19562Assert.Equal("default", node.ToString());
19643var node = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First();
19645Assert.Equal("default", node.ToString());
19735var node = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First();
19737Assert.Equal("default", node.ToString());
19824var node = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First();
19826Assert.Equal("default", node.ToString());
28773var node = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First();
28775Assert.Equal("default", node.ToString());
30282Assert.Equal("return " + (needCast ? "(int)" : "") + @"x;", node.ToString());
30473Assert.Equal("x " + op + " x", node.ToString());
30939Assert.Equal("return " + (needCast ? "(T)" : "") + @"x;", node.ToString());
Symbols\UnsignedRightShiftTests.cs (13)
126Assert.Equal("x >>> y", unsignedShift.ToString());
127Assert.Equal("x >> y", shift.ToString());
629Assert.Equal("z1 >>>= y", unsignedShift.ToString());
630Assert.Equal("z1 >>= y", shift.ToString());
1179Assert.Equal("x >>> y", unsignedShift.ToString());
1180Assert.Equal("x >> y", shift.ToString());
1587Assert.Equal("z1 >>>= y", unsignedShift.ToString());
1588Assert.Equal("z1 >>= y", shift.ToString());
1985Assert.Equal("x >>> y", unsignedShift.ToString());
2237Assert.Equal("x >>> y", unsignedShift.ToString());
2379Assert.Equal("x >>>= y", unsignedShift.ToString());
2513Assert.Equal("x >>> y", unsignedShift.ToString());
2610Assert.Equal("x >>>= y", unsignedShift.ToString());
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (890)
Parsing\DeclarationParsingTests.cs (319)
36Assert.Equal(text, file.ToString());
59Assert.Equal(text, file.ToString());
69Assert.Equal("a", ud.Name.ToString());
81Assert.Equal(text, file.ToString());
91Assert.Equal("a", ud.Name.ToString());
118Assert.Equal(text, file.ToString());
133Assert.Equal(text, file.ToString());
148Assert.Equal(text, file.ToString());
158Assert.Equal("a.b", ud.Name.ToString());
170Assert.Equal(text, file.ToString());
180Assert.Equal("a.b", ud.Name.ToString());
192Assert.Equal(text, file.ToString());
202Assert.Equal("a<int?>", ud.Name.ToString());
214Assert.Equal(text, file.ToString());
223Assert.Equal("a", ud.Alias.Name.ToString());
226Assert.Equal("b", ud.Name.ToString());
238Assert.Equal(text, file.ToString());
247Assert.Equal("a", ud.Alias.Name.ToString());
250Assert.Equal("b<c>", ud.Name.ToString());
262Assert.Equal(text, file.ToString());
275Assert.Equal("a", ad.Attributes[0].Name.ToString());
288Assert.Equal(text, file.ToString());
304Assert.Equal("a", ad.Attributes[0].Name.ToString());
317Assert.Equal(text, file.ToString());
333Assert.Equal("a", ad.Attributes[0].Name.ToString());
346Assert.Equal(text, file.ToString());
360Assert.Equal("a", ad.Attributes[0].Name.ToString());
373Assert.Equal(text, file.ToString());
388Assert.Equal("a", ad.Attributes[0].Name.ToString());
401Assert.Equal(text, file.ToString());
415Assert.Equal("a", ad.Attributes[0].Name.ToString());
431Assert.Equal(text, file.ToString());
444Assert.Equal("a", ad.Attributes[0].Name.ToString());
448Assert.Equal("b", ad.Attributes[0].ArgumentList.Arguments[0].ToString());
449Assert.Equal("c", ad.Attributes[0].ArgumentList.Arguments[1].ToString());
462Assert.Equal(text, file.ToString());
475Assert.Equal("a", ad.Attributes[0].Name.ToString());
479Assert.Equal("b = c", ad.Attributes[0].ArgumentList.Arguments[0].ToString());
482Assert.Equal("b", ad.Attributes[0].ArgumentList.Arguments[0].NameEquals.Name.ToString());
485Assert.Equal("c", ad.Attributes[0].ArgumentList.Arguments[0].Expression.ToString());
498Assert.Equal(text, file.ToString());
512Assert.Equal("a", ad.Attributes[0].Name.ToString());
516Assert.Equal("b", ad.Attributes[1].Name.ToString());
530Assert.Equal(text, file.ToString());
542Assert.Equal("a", ad.Attributes[0].Name.ToString());
554Assert.Equal("b", ad.Attributes[0].Name.ToString());
567Assert.Equal(text, file.ToString());
574Assert.Equal("a", ns.Name.ToString());
589Assert.Equal(text, file.ToString());
596Assert.Equal("a", ns.Name.ToString());
610Assert.Equal(text, file.ToString());
617Assert.Equal("a.b.c", ns.Name.ToString());
632Assert.Equal(text, file.ToString());
639Assert.Equal("a", ns.Name.ToString());
642Assert.Equal("using b.c;", ns.Usings[0].ToString());
655Assert.Equal(text, file.ToString());
662Assert.Equal("a", ns.Name.ToString());
665Assert.Equal("using b.c;", ns.Usings[0].ToString());
677Assert.Equal(text, file.ToString());
684Assert.Equal("a", ns.Name.ToString());
687Assert.Equal("extern alias b;", ns.Externs[0].ToString());
700Assert.Equal(text, file.ToString());
707Assert.Equal("a", ns.Name.ToString());
710Assert.Equal("extern alias b;", ns.Externs[0].ToString());
729Assert.Equal("a", ns.Name.ToString());
732Assert.Equal("using b;", ns.Usings[0].ToString());
746Assert.Equal(text, file.ToString());
753Assert.Equal("a", ns.Name.ToString());
761Assert.Equal("b", ns2.Name.ToString());
777Assert.Equal(text, file.ToString());
803Assert.Equal(text, file.ToString());
830Assert.Equal(text, file.ToString());
857Assert.Equal(text, file.ToString());
884Assert.Equal(text, file.ToString());
911Assert.Equal(text, file.ToString());
938Assert.Equal(text, file.ToString());
965Assert.Equal(text, file.ToString());
971Assert.Equal("[attr]", cs.AttributeLists[0].ToString());
992Assert.Equal(text, file.ToString());
998Assert.Equal("[attr1]", cs.AttributeLists[0].ToString());
999Assert.Equal("[attr2]", cs.AttributeLists[1].ToString());
1020Assert.Equal(text, file.ToString());
1026Assert.Equal("[attr1, attr2]", cs.AttributeLists[0].ToString());
1047Assert.Equal(text, file.ToString());
1062Assert.Equal("b", cs.BaseList.Types[0].Type.ToString());
1078Assert.Equal(text, file.ToString());
1093Assert.Equal("b", cs.BaseList.Types[0].Type.ToString());
1094Assert.Equal("c", cs.BaseList.Types[1].Type.ToString());
1110Assert.Equal(text, file.ToString());
1121Assert.Equal("<b>", cs.TypeParameterList.ToString());
1128Assert.Equal("b", cs.ConstraintClauses[0].Name.ToString());
1135Assert.Equal("c", bound.Type.ToString());
1150Assert.Equal(text, file.ToString());
1169Assert.Equal("b", cs.ConstraintClauses[0].Name.ToString());
1176Assert.Equal("c", bound.Type.ToString());
1213Assert.Equal(text, file.ToString());
1224Assert.Equal("<b>", cs.TypeParameterList.ToString());
1231Assert.Equal("b", cs.ConstraintClauses[0].Name.ToString());
1257Assert.Equal(text, file.ToString());
1268Assert.Equal("<b>", cs.TypeParameterList.ToString());
1275Assert.Equal("b", cs.ConstraintClauses[0].Name.ToString());
1298Assert.Equal(text, file.ToString());
1309Assert.Equal("<b>", cs.TypeParameterList.ToString());
1316Assert.Equal("b", cs.ConstraintClauses[0].Name.ToString());
1339Assert.Equal(text, file.ToString());
1350Assert.Equal("<b>", cs.TypeParameterList.ToString());
1357Assert.Equal("b", cs.ConstraintClauses[0].Name.ToString());
1371Assert.Equal("c", typeBound.Type.ToString());
1395Assert.Equal(text, file.ToString());
1405Assert.Equal("<b>", cs.TypeParameterList.ToString());
1413Assert.Equal("b", cs.ConstraintClauses[0].Name.ToString());
1420Assert.Equal("c", typeBound.Type.ToString());
1424Assert.Equal("b", cs.ConstraintClauses[1].Name.ToString());
1450Assert.Equal(text, file.ToString());
1460Assert.Equal("<b>", cs.TypeParameterList.ToString());
1468Assert.Equal("b", cs.ConstraintClauses[0].Name.ToString());
1475Assert.Equal("c", typeBound.Type.ToString());
1479Assert.Equal("b", cs.ConstraintClauses[1].Name.ToString());
1496Assert.Equal(text, file.ToString());
1506Assert.Equal("<b>", cs.TypeParameterList.ToString());
1514Assert.Equal("b", cs.ConstraintClauses[0].Name.ToString());
1521Assert.Equal("c", typeBound.Type.ToString());
1540Assert.Equal(text, file.ToString());
1551Assert.Equal("<b>", cs.TypeParameterList.ToString());
1556Assert.Equal("c", cs.BaseList.Types[0].Type.ToString());
1557Assert.Equal("d", cs.BaseList.Types[1].Type.ToString());
1562Assert.Equal("b", cs.ConstraintClauses[0].Name.ToString());
1576Assert.Equal("e", typeBound.Type.ToString());
1600Assert.Equal(text, file.ToString());
1625Assert.Equal(text, file.ToString());
1636Assert.Equal("<B>", gn.ToString());
1655Assert.Equal(text, file.ToString());
1667Assert.Equal("<[B] out C>", gn.ToString());
1670Assert.Equal("B", gn.Parameters[0].AttributeLists[0].Attributes[0].Name.ToString());
1687Assert.Equal(text, file.ToString());
1712Assert.Equal(text, file.ToString());
1752Assert.Equal(text, file.ToString());
1793Assert.Equal(text, file.ToString());
1834Assert.Equal(text, file.ToString());
1876Assert.Equal(text, file.ToString());
1918Assert.Equal(text, file.ToString());
1959Assert.Equal(text, file.ToString());
2000Assert.Equal(text, file.ToString());
2007Assert.Equal("a", ds.ReturnType.ToString());
2027Assert.Equal(text, file.ToString());
2034Assert.Equal("ref a", ds.ReturnType.ToString());
2055Assert.Equal(text, file.ToString());
2062Assert.Equal("ref readonly a", ds.ReturnType.ToString());
2102Assert.Equal(text, file.ToString());
2109Assert.Equal(typeText, ds.ReturnType.ToString());
2148Assert.Equal(text, file.ToString());
2155Assert.Equal("a", ds.ReturnType.ToString());
2165Assert.Equal(typeText, ds.ParameterList.Parameters[0].Type.ToString());
2183Assert.Equal(text, file.ToString());
2190Assert.Equal("a", ds.ReturnType.ToString());
2200Assert.Equal("c", ds.ParameterList.Parameters[0].Type.ToString());
2218Assert.Equal(text, file.ToString());
2225Assert.Equal("a", ds.ReturnType.ToString());
2235Assert.Equal("c", ds.ParameterList.Parameters[0].Type.ToString());
2242Assert.Equal("e", ds.ParameterList.Parameters[1].Type.ToString());
2260Assert.Equal(text, file.ToString());
2267Assert.Equal("a", ds.ReturnType.ToString());
2278Assert.Equal("c", ds.ParameterList.Parameters[0].Type.ToString());
2296Assert.Equal(text, file.ToString());
2303Assert.Equal("a", ds.ReturnType.ToString());
2314Assert.Equal("c", ds.ParameterList.Parameters[0].Type.ToString());
2332Assert.Equal(text, file.ToString());
2339Assert.Equal("a", ds.ReturnType.ToString());
2350Assert.Equal("c", ds.ParameterList.Parameters[0].Type.ToString());
2368Assert.Equal(text, file.ToString());
2376Assert.Equal("a", ds.ReturnType.ToString());
2402Assert.Equal(text, file.ToString());
2409Assert.Equal("a", ds.ReturnType.ToString());
2417Assert.Equal("[attr]", ds.ParameterList.Parameters[0].AttributeLists[0].ToString());
2420Assert.Equal("c", ds.ParameterList.Parameters[0].Type.ToString());
2438Assert.Equal(text, file.ToString());
2460Assert.Equal("b", ds.ReturnType.ToString());
2480Assert.Equal(text, file.ToString());
2503Assert.Equal("b", ms.ReturnType.ToString());
2526Assert.Equal(text, file.ToString());
2548Assert.Equal("ref b", ms.ReturnType.ToString());
2572Assert.Equal(text, file.ToString());
2594Assert.Equal("ref readonly b", ms.ReturnType.ToString());
2617Assert.Equal(text, file.ToString());
2647Assert.Equal(text, file.ToString());
2675Assert.Equal(text, file.ToString());
2702Assert.Equal("b", ms.ReturnType.ToString());
2743Assert.Equal(text, file.ToString());
2767Assert.Equal("void", ms.ReturnType.ToString());
2790Assert.Equal(text, file.ToString());
2814Assert.Equal("void", ms.ReturnType.ToString());
2837Assert.Equal(text, file.ToString());
2864Assert.Equal("int", rt.Type.ToString());
2887Assert.Equal(text, file.ToString());
2911Assert.Equal("int", propertySyntax.Type.ToString());
2928Assert.Equal(text, file.ToString());
2951Assert.Equal("int", propertySyntax.Type.ToString());
2973Assert.Equal(text, file.ToString());
2989Assert.Equal(text, file.ToString());
3012Assert.Equal("b", ms.ReturnType.ToString());
3021Assert.Equal("c", ms.ParameterList.Parameters[0].Type.ToString());
3041Assert.Equal(text, file.ToString());
3064Assert.Equal("b", ms.ReturnType.ToString());
3075Assert.Equal("c", ms.ParameterList.Parameters[0].Type.ToString());
3082Assert.Equal("e", ms.ParameterList.Parameters[1].Type.ToString());
3102Assert.Equal(text, file.ToString());
3125Assert.Equal("b", ms.ReturnType.ToString());
3137Assert.Equal("c", ms.ParameterList.Parameters[0].Type.ToString());
3167Assert.Equal(text, file.ToString());
3190Assert.Equal("b", ms.ReturnType.ToString());
3241Assert.Equal(text, file.ToString());
3264Assert.Equal(typeText, ms.ReturnType.ToString());
3306Assert.Equal(text, file.ToString());
3329Assert.Equal("b", ms.ReturnType.ToString());
3338Assert.Equal(typeText, ms.ParameterList.Parameters[0].Type.ToString());
3358Assert.Equal(text, file.ToString());
3381Assert.Equal("b<c>", ms.ReturnType.ToString());
3404Assert.Equal(text, file.ToString());
3427Assert.Equal("b", ms.ReturnType.ToString());
3431Assert.Equal("<c>", ms.TypeParameterList.ToString());
3441Assert.Equal("b", ms.ConstraintClauses[0].Name.ToString());
3448Assert.Equal("d", typeBound.Type.ToString());
3485Assert.Equal(text, file.ToString());
3520Assert.Equal(text, file.ToString());
3567Assert.Equal(text, file.ToString());
3604Assert.Equal(text, file.ToString());
3627Assert.Equal("b", fs.Declaration.Type.ToString());
3664Assert.Equal(text, file.ToString());
3687Assert.Equal(typeText, fs.Declaration.Type.ToString());
3704Assert.Equal(text, file.ToString());
3728Assert.Equal("b", fs.Declaration.Type.ToString());
3758Assert.Equal(text, file.ToString());
3783Assert.Equal("b", fs.Declaration.Type.ToString());
3814Assert.Equal(text, file.ToString());
3838Assert.Equal("b", fs.Declaration.Type.ToString());
3846Assert.Equal("d", fs.Declaration.Variables[0].Initializer.Value.ToString());
3859Assert.Equal(text, file.ToString());
3882Assert.Equal("b", fs.Declaration.Type.ToString());
3890Assert.Equal("e", fs.Declaration.Variables[0].Initializer.Value.ToString());
3903Assert.Equal(text, file.ToString());
3926Assert.Equal("b", fs.Declaration.Type.ToString());
3935Assert.Equal("{ }", fs.Declaration.Variables[0].Initializer.Value.ToString());
3948Assert.Equal(text, file.ToString());
3971Assert.Equal("b", fs.Declaration.Type.ToString());
4002Assert.Equal(text, file.ToString());
4025Assert.Equal("b", fs.Declaration.Type.ToString());
4035Assert.Equal("x", fs.Declaration.Variables[0].Initializer.Value.ToString());
4043Assert.Equal("y", fs.Declaration.Variables[1].Initializer.Value.ToString());
4051Assert.Equal("z", fs.Declaration.Variables[2].Initializer.Value.ToString());
4065Assert.Equal(text, file.ToString());
4089Assert.Equal("b", fs.Declaration.Type.ToString());
4097Assert.Equal("10", fs.Declaration.Variables[0].ArgumentList.Arguments[0].ToString());
4111Assert.Equal(text, file.ToString());
4134Assert.Equal("b", ps.Type.ToString());
4165Assert.Equal(text, file.ToString());
4188Assert.Equal("ref b", ps.Type.ToString());
4220Assert.Equal(text, file.ToString());
4243Assert.Equal("ref readonly b", ps.Type.ToString());
4293Assert.Equal(text, file.ToString());
4316Assert.Equal(typeText, ps.Type.ToString());
4347Assert.Equal(text, file.ToString());
4370Assert.Equal("b", ps.Type.ToString());
4401Assert.Equal(text, file.ToString());
4424Assert.Equal("b", ps.Type.ToString());
4446Assert.Equal("d", ps.Initializer.Value.ToString());
4485Assert.Equal(text, file.ToString());
4508Assert.Equal("b", ps.Type.ToString());
4541Assert.Equal(text, file.ToString());
4564Assert.Equal("b", es.Type.ToString());
4597Assert.Equal(text, file.ToString());
4621Assert.Equal("b", ps.Type.ToString());
4681Assert.Equal(text, file.ToString());
4704Assert.Equal("b", ps.Type.ToString());
4707Assert.Equal("I", ps.ExplicitInterfaceSpecifier.Name.ToString());
4737Assert.Equal(text, file.ToString());
4761Assert.Equal("b", es.Type.ToString());
4791Assert.Equal(text, file.ToString());
4816Assert.Equal("b", es.Type.ToString());
4874Assert.Equal(text, file.ToString());
4898Assert.Equal("b", es.Type.ToString());
4901Assert.Equal("I", es.ExplicitInterfaceSpecifier.Name.ToString());
4931Assert.Equal(text, file.ToString());
4954Assert.Equal("b", ps.Type.ToString());
4967Assert.Equal("c", ps.ParameterList.Parameters[0].Type.ToString());
4998Assert.Equal(text, file.ToString());
5021Assert.Equal("ref b", ps.Type.ToString());
5034Assert.Equal("c", ps.ParameterList.Parameters[0].Type.ToString());
5066Assert.Equal(text, file.ToString());
5089Assert.Equal("ref readonly b", ps.Type.ToString());
5102Assert.Equal("c", ps.ParameterList.Parameters[0].Type.ToString());
5133Assert.Equal(text, file.ToString());
5156Assert.Equal("b", ps.Type.ToString());
5171Assert.Equal("c", ps.ParameterList.Parameters[0].Type.ToString());
5178Assert.Equal("e", ps.ParameterList.Parameters[1].Type.ToString());
5209Assert.Equal(text, file.ToString());
5232Assert.Equal("b", ps.Type.ToString());
5234Assert.Equal("I", ps.ExplicitInterfaceSpecifier.Name.ToString());
5247Assert.Equal("c", ps.ParameterList.Parameters[0].Type.ToString());
5277Assert.Equal(text, file.ToString());
5300Assert.Equal("b", ps.ReturnType.ToString());
5314Assert.Equal("c", ps.ParameterList.Parameters[0].Type.ToString());
5321Assert.Equal("e", ps.ParameterList.Parameters[1].Type.ToString());
5357Assert.Equal(text, file.ToString());
5380Assert.Equal("b", ps.ReturnType.ToString());
5394Assert.Equal("c", ps.ParameterList.Parameters[0].Type.ToString());
5401Assert.Equal("e", ps.ParameterList.Parameters[1].Type.ToString());
5471Assert.Equal(text, file.ToString());
5494Assert.Equal("b", ps.ReturnType.ToString());
5508Assert.Equal("c", ps.ParameterList.Parameters[0].Type.ToString());
5534Assert.Equal(text, file.ToString());
5561Assert.Equal("b", ms.Type.ToString());
5569Assert.Equal("c", ms.ParameterList.Parameters[0].Type.ToString());
5582Assert.Equal(text, file.ToString());
5609Assert.Equal("b", ms.Type.ToString());
5617Assert.Equal("c", ms.ParameterList.Parameters[0].Type.ToString());
5631Assert.Equal(text, file.ToString());
5643Assert.Equal(text, file.ToString());
5655Assert.Equal(text, file.ToString());
5891var stmtText = statement.ToString();
Parsing\ExpressionParsingTests.cs (220)
39Assert.Equal(text, expr.ToString());
421Assert.Equal("Text with ", expr.Contents[0].ToString());
422Assert.Equal(" parts and new line expressions!", expr.Contents[2].ToString());
434Assert.Equal(text, expr.ToString());
446Assert.Equal(text, expr.ToString());
571Assert.Equal(text, expr.ToString());
578Assert.Equal("a", us.Operand.ToString());
602Assert.Equal(text, expr.ToString());
609Assert.Equal("a", us.Operand.ToString());
628Assert.Equal(text, expr.ToString());
635Assert.Equal("(a)", b.Left.ToString());
636Assert.Equal("b", b.Right.ToString());
674Assert.Equal(text, expr.ToString());
681Assert.Equal("(a)", a.Left.ToString());
682Assert.Equal("b", a.Right.ToString());
709Assert.Equal(text, expr.ToString());
716Assert.Equal("(a)", e.Expression.ToString());
717Assert.Equal("b", e.Name.ToString());
734Assert.Equal(text, expr.ToString());
738Assert.Equal("a.b", e.Expression.ToString());
739Assert.Equal(".c.d?[1]?.e()?.f", e.WhenNotNull.ToString());
767Assert.Equal(text, expr.ToString());
771Assert.Equal("a.b", e.Expression.ToString());
773Assert.Equal(".c.d?[1]?.e()?.f", cons.ToString());
777Assert.Equal(".c.d", e.Expression.ToString());
779Assert.Equal("[1]?.e()?.f", cons.ToString());
783Assert.Equal("[1]", e.Expression.ToString());
785Assert.Equal(".e()?.f", cons.ToString());
789Assert.Equal(".e()", e.Expression.ToString());
791Assert.Equal(".f", cons.ToString());
807Assert.Equal("a", arg.ToString());
818Assert.Equal(text, expr.ToString());
881Assert.Equal(text, expr.ToString());
890Assert.Equal("a", fs.Expression.ToString());
891Assert.Equal("b", fs.Type.ToString());
902Assert.Equal(text, expr.ToString());
909Assert.Equal("a", ts.Condition.ToString());
910Assert.Equal("b", ts.WhenTrue.ToString());
911Assert.Equal("c", ts.WhenFalse.ToString());
932Assert.Equal(text, expr.ToString());
941Assert.Equal("a", cs.Type.ToString());
942Assert.Equal("b", cs.Expression.ToString());
953Assert.Equal(text, expr.ToString());
962Assert.Equal("a", cs.Expression.ToString());
963Assert.Equal("b", cs.ArgumentList.Arguments[0].ToString());
974Assert.Equal(text, expr.ToString());
983Assert.Equal("a", cs.Expression.ToString());
984Assert.Equal("ref b", cs.ArgumentList.Arguments[0].ToString());
988Assert.Equal("b", cs.ArgumentList.Arguments[0].Expression.ToString());
999Assert.Equal(text, expr.ToString());
1008Assert.Equal("a", cs.Expression.ToString());
1009Assert.Equal("out b", cs.ArgumentList.Arguments[0].ToString());
1013Assert.Equal("b", cs.ArgumentList.Arguments[0].Expression.ToString());
1024Assert.Equal(text, expr.ToString());
1033Assert.Equal("a", cs.Expression.ToString());
1034Assert.Equal("B: b", cs.ArgumentList.Arguments[0].ToString());
1036Assert.Equal("B", cs.ArgumentList.Arguments[0].NameColon.Name.ToString());
1038Assert.Equal("b", cs.ArgumentList.Arguments[0].Expression.ToString());
1049Assert.Equal(text, expr.ToString());
1058Assert.Equal("a", ea.Expression.ToString());
1059Assert.Equal("b", ea.ArgumentList.Arguments[0].ToString());
1070Assert.Equal(text, expr.ToString());
1079Assert.Equal("a", ea.Expression.ToString());
1080Assert.Equal("ref b", ea.ArgumentList.Arguments[0].ToString());
1084Assert.Equal("b", ea.ArgumentList.Arguments[0].Expression.ToString());
1095Assert.Equal(text, expr.ToString());
1104Assert.Equal("a", ea.Expression.ToString());
1105Assert.Equal("out b", ea.ArgumentList.Arguments[0].ToString());
1109Assert.Equal("b", ea.ArgumentList.Arguments[0].Expression.ToString());
1120Assert.Equal(text, expr.ToString());
1129Assert.Equal("a", ea.Expression.ToString());
1130Assert.Equal("B: b", ea.ArgumentList.Arguments[0].ToString());
1141Assert.Equal(text, expr.ToString());
1151Assert.Equal("a", oc.Type.ToString());
1163Assert.Equal(text, expr.ToString());
1172Assert.Equal("b", oc.ArgumentList.Arguments[0].ToString());
1174Assert.Equal("a", oc.Type.ToString());
1186Assert.Equal(text, expr.ToString());
1195Assert.Equal("B: b", oc.ArgumentList.Arguments[0].ToString());
1197Assert.Equal("a", oc.Type.ToString());
1209Assert.Equal(text, expr.ToString());
1219Assert.Equal("a", oc.Type.ToString());
1237Assert.Equal(text, expr.ToString());
1242Assert.Equal("a", oc.Type.ToString());
1260Assert.Equal(text, expr.ToString());
1265Assert.Equal("a", oc.Type.ToString());
1273Assert.Equal("b", oc.Initializer.Expressions[0].ToString());
1284Assert.Equal(text, expr.ToString());
1289Assert.Equal("a", oc.Type.ToString());
1297Assert.Equal("b", oc.Initializer.Expressions[0].ToString());
1298Assert.Equal("c", oc.Initializer.Expressions[1].ToString());
1299Assert.Equal("d", oc.Initializer.Expressions[2].ToString());
1310Assert.Equal(text, expr.ToString());
1315Assert.Equal("a", oc.Type.ToString());
1323Assert.Equal("B = b", oc.Initializer.Expressions[0].ToString());
1334Assert.Equal(text, expr.ToString());
1339Assert.Equal("a", oc.Type.ToString());
1347Assert.Equal("B = { X = x }", oc.Initializer.Expressions[0].ToString());
1350Assert.Equal("B", b.Left.ToString());
1362Assert.Equal(text, expr.ToString());
1366Assert.Equal("a[1]", ac.Type.ToString());
1840Assert.Equal(text, expr.ToString());
1844Assert.Equal("a[]", ac.Type.ToString());
1851Assert.Equal("b", ac.Initializer.Expressions[0].ToString());
1862Assert.Equal(text, expr.ToString());
1866Assert.Equal("a[]", ac.Type.ToString());
1873Assert.Equal("b", ac.Initializer.Expressions[0].ToString());
1874Assert.Equal("c", ac.Initializer.Expressions[1].ToString());
1875Assert.Equal("d", ac.Initializer.Expressions[2].ToString());
1886Assert.Equal(text, expr.ToString());
1890Assert.Equal("a[][,][,,]", ac.Type.ToString());
1897Assert.Equal("b", ac.Initializer.Expressions[0].ToString());
1908Assert.Equal(text, expr.ToString());
1917Assert.Equal("b", ac.Initializer.Expressions[0].ToString());
1928Assert.Equal(text, expr.ToString());
1937Assert.Equal("a", ac.Initializers[0].ToString());
1938Assert.Equal("b", ac.Initializers[1].ToString());
1949Assert.Equal(text, expr.ToString());
1962Assert.Equal("int a", am.ParameterList.Parameters[0].ToString());
1980Assert.Equal(text, expr.ToString());
2010Assert.Equal(text, expr.ToString());
2035Assert.Equal(text, expr.ToString());
2042Assert.Equal("b", lambda.Body.ToString());
2053Assert.Equal(text, expr.ToString());
2060Assert.Equal("ref b", lambda.Body.ToString());
2071Assert.Equal(text, expr.ToString());
2080Assert.Equal("{ }", lambda.Body.ToString());
2091Assert.Equal(text, expr.ToString());
2100Assert.Equal("b", lambda.Body.ToString());
2111Assert.Equal(text, expr.ToString());
2120Assert.Equal("ref b", lambda.Body.ToString());
2131Assert.Equal(text, expr.ToString());
2142Assert.Equal("{ }", lambda.Body.ToString());
2153Assert.Equal(text, expr.ToString());
2166Assert.Equal("b", lambda.Body.ToString());
2177Assert.Equal(text, expr.ToString());
2193Assert.Equal("b", lambda.Body.ToString());
2204Assert.Equal(text, expr.ToString());
2215Assert.Equal("T", ps.Type.ToString());
2218Assert.Equal("b", lambda.Body.ToString());
2229Assert.Equal(text, expr.ToString());
2240Assert.Equal("T", ps.Type.ToString());
2245Assert.Equal("b", lambda.Body.ToString());
2256Assert.Equal(text, expr.ToString());
2276Assert.Equal(text, expr.ToString());
2286Assert.Equal("arg2", tuple.Arguments[1].NameColon.Name.ToString());
2297Assert.Equal(text, expr.ToString());
2311Assert.Equal("A", fs.Expression.ToString());
2318Assert.Equal("b", ss.Expression.ToString());
2330Assert.Equal(text, expr.ToString());
2341Assert.Equal("T", fs.Type.ToString());
2345Assert.Equal("A", fs.Expression.ToString());
2351Assert.Equal("b", ss.Expression.ToString());
2363Assert.Equal(text, expr.ToString());
2378Assert.Equal("A", fs.Expression.ToString());
2384Assert.Equal("b", ss.Expression.ToString());
2401Assert.Equal("d", ss.Expression.ToString());
2414Assert.Equal(text, expr.ToString());
2428Assert.Equal("A", fs.Expression.ToString());
2436Assert.Equal("b", ws.Condition.ToString());
2442Assert.Equal("c", ss.Expression.ToString());
2454Assert.Equal(text, expr.ToString());
2468Assert.Equal("A", fs.Expression.ToString());
2479Assert.Equal("B", fs.Expression.ToString());
2485Assert.Equal("c", ss.Expression.ToString());
2497Assert.Equal(text, expr.ToString());
2511Assert.Equal("A", fs.Expression.ToString());
2524Assert.Equal("B", ls.Expression.ToString());
2530Assert.Equal("c", ss.Expression.ToString());
2542Assert.Equal(text, expr.ToString());
2556Assert.Equal("A", fs.Expression.ToString());
2569Assert.Equal("b", os.Expression.ToString());
2575Assert.Equal("c", ss.Expression.ToString());
2587Assert.Equal(text, expr.ToString());
2601Assert.Equal("A", fs.Expression.ToString());
2613Assert.Equal("b", os.Expression.ToString());
2618Assert.Equal("b2", os.Expression.ToString());
2624Assert.Equal("c", ss.Expression.ToString());
2636Assert.Equal(text, expr.ToString());
2650Assert.Equal("A", fs.Expression.ToString());
2666Assert.Equal("b", os.Expression.ToString());
2672Assert.Equal("c", ss.Expression.ToString());
2684Assert.Equal(text, expr.ToString());
2698Assert.Equal("A", fs.Expression.ToString());
2714Assert.Equal("b", os.Expression.ToString());
2720Assert.Equal("c", ss.Expression.ToString());
2732Assert.Equal(text, expr.ToString());
2745Assert.Equal("A", fs.Expression.ToString());
2753Assert.Equal("b", gbs.GroupExpression.ToString());
2758Assert.Equal("c", gbs.ByExpression.ToString());
2771Assert.Equal(text, expr.ToString());
2784Assert.Equal("A", fs.Expression.ToString());
2791Assert.Equal("b", gbs.GroupExpression.ToString());
2795Assert.Equal("c", gbs.ByExpression.ToString());
2811Assert.Equal("e", ss.Expression.ToString());
2824Assert.Equal(text, expr.ToString());
2838Assert.Equal("A", fs.Expression.ToString());
2851Assert.Equal("B", js.InExpression.ToString());
2856Assert.Equal("a", js.LeftExpression.ToString());
2861Assert.Equal("b", js.RightExpression.ToString());
2868Assert.Equal("c", ss.Expression.ToString());
2880Assert.Equal(text, expr.ToString());
2891Assert.Equal("Ta", fs.Type.ToString());
2895Assert.Equal("A", fs.Expression.ToString());
2902Assert.Equal("Tb", js.Type.ToString());
2908Assert.Equal("B", js.InExpression.ToString());
2912Assert.Equal("a", js.LeftExpression.ToString());
2916Assert.Equal("b", js.RightExpression.ToString());
2923Assert.Equal("c", ss.Expression.ToString());
2935Assert.Equal(text, expr.ToString());
2949Assert.Equal("A", fs.Expression.ToString());
2961Assert.Equal("B", js.InExpression.ToString());
2965Assert.Equal("a", js.LeftExpression.ToString());
2969Assert.Equal("b", js.RightExpression.ToString());
2980Assert.Equal("d", ss.Expression.ToString());
2992Assert.Equal(text, expr.ToString());
3001Assert.Equal("x", gs.GroupExpression.ToString());
3002Assert.Equal("y", gs.ByExpression.ToString());
3043Assert.Equal(text, expr.ToString());
4765Assert.Equal(text, expr.ToString());
Parsing\NameParsingTests.cs (39)
39Assert.Equal(text, name.ToString());
66Assert.Equal(string.Empty, name.ToString());
81Assert.Equal(string.Empty, name.ToString());
96Assert.Equal(string.Empty, name.ToString());
111Assert.Equal(string.Empty, name.ToString());
124Assert.Equal(text, name.ToString());
139Assert.Equal(text, name.ToString());
152Assert.Equal(text, name.ToString());
165Assert.Equal(text, name.ToString());
194Assert.Equal(text, name.ToString());
215Assert.Equal(text, name.ToString());
231Assert.Equal(text, name.ToString());
249Assert.Equal(text, name.ToString());
308Assert.Equal(text, name.ToString());
325Assert.Equal(text, name.ToString());
339Assert.Equal(text, name.ToString());
353Assert.Equal(text, name.ToString());
370Assert.Equal(text, name.ToString());
389Assert.Equal(text, name.ToString());
449Assert.Equal(text, name.ToString());
478Assert.Equal(text, tname.ToString());
491Assert.Equal(text, tname.ToString());
506Assert.Equal(text, tname.ToString());
520Assert.Equal(text, tname.ToString());
546Assert.Equal(text, tname.ToString());
568Assert.Equal(text, tname.ToString());
590Assert.Equal(text, tname.ToString());
621Assert.Equal(text, tname.ToString());
636Assert.Equal(text, tname.ToString());
646Assert.Equal(text, tname.ToString());
661Assert.Equal(text, tname.ToString());
672Assert.Equal(text, tname.ToString());
687Assert.Equal(text, tname.ToString());
698Assert.Equal(text, tname.ToString());
719Assert.Equal(text, tname.ToString());
730Assert.Equal(text, tname.ToString());
745Assert.Equal(text, tname.ToString());
755Assert.Equal(text, tname.ToString());
771Assert.Equal(text, tname.ToString());
Parsing\StatementParsingTests.cs (234)
60Assert.Equal(text, statement.ToString());
67Assert.Equal("a()", es.Expression.ToString());
80Assert.Equal(text, statement.ToString());
87Assert.Equal("a.b()", es.Expression.ToString());
100Assert.Equal(text, statement.ToString());
106Assert.Equal("a<b>()", es.Expression.ToString());
119Assert.Equal(text, statement.ToString());
126Assert.Equal("a<b>.c()", es.Expression.ToString());
139Assert.Equal(text, statement.ToString());
146Assert.Equal("a.b<c>()", es.Expression.ToString());
158Assert.Equal(text, statement.ToString());
169Assert.Equal("a", us.Operand.ToString());
189Assert.Equal(text, statement.ToString());
195Assert.Equal("T", ds.Declaration.Type.ToString());
217Assert.Equal(text, statement.ToString());
223Assert.Equal("var", ds.Declaration.Type.ToString());
247Assert.Equal(text, statement.ToString());
253Assert.Equal("(int, int)", ds.Declaration.Type.ToString());
281Assert.Equal(text, statement.ToString());
287Assert.Equal("(T x, (U k, V l, W m) y)", ds.Declaration.Type.ToString());
298Assert.Equal("(U k, V l, W m)", tt.ToString());
322Assert.Equal(text, statement.ToString());
328Assert.Equal("dynamic", ds.Declaration.Type.ToString());
350Assert.Equal(text, statement.ToString());
356Assert.Equal("T<a>", ds.Declaration.Type.ToString());
376Assert.Equal(text, statement.ToString());
382Assert.Equal("T.X.Y", ds.Declaration.Type.ToString());
402Assert.Equal(text, statement.ToString());
408Assert.Equal("T<t>.X<x>.Y<y>", ds.Declaration.Type.ToString());
428Assert.Equal(text, statement.ToString());
434Assert.Equal("T[][,][,,]", ds.Declaration.Type.ToString());
454Assert.Equal(text, statement.ToString());
460Assert.Equal("T*", ds.Declaration.Type.ToString());
480Assert.Equal(text, statement.ToString());
486Assert.Equal("T?", ds.Declaration.Type.ToString());
506Assert.Equal(text, statement.ToString());
512Assert.Equal("T", ds.Declaration.Type.ToString());
541Assert.Equal(text, statement.ToString());
547Assert.Equal("T", ds.Declaration.Type.ToString());
557Assert.Equal("b", ds.Declaration.Variables[0].Initializer.Value.ToString());
571Assert.Equal(text, statement.ToString());
577Assert.Equal("T", ds.Declaration.Type.ToString());
586Assert.Equal("va", ds.Declaration.Variables[0].Initializer.Value.ToString());
594Assert.Equal("vb", ds.Declaration.Variables[1].Initializer.Value.ToString());
602Assert.Equal("vc", ds.Declaration.Variables[2].Initializer.Value.ToString());
616Assert.Equal(text, statement.ToString());
622Assert.Equal("T", ds.Declaration.Type.ToString());
633Assert.Equal("{b, c}", ds.Declaration.Variables[0].Initializer.Value.ToString());
647Assert.Equal(text, statement.ToString());
654Assert.Equal("T", ds.Declaration.Type.ToString());
664Assert.Equal("b", ds.Declaration.Variables[0].Initializer.Value.ToString());
678Assert.Equal(text, statement.ToString());
686Assert.Equal("T", ds.Declaration.Type.ToString());
696Assert.Equal("b", ds.Declaration.Variables[0].Initializer.Value.ToString());
710Assert.Equal(text, statement.ToString());
718Assert.Equal("T", ds.Declaration.Type.ToString());
728Assert.Equal("b", ds.Declaration.Variables[0].Initializer.Value.ToString());
742Assert.Equal(text, statement.ToString());
750Assert.Equal("T", ds.Declaration.Type.ToString());
760Assert.Equal("b", ds.Declaration.Variables[0].Initializer.Value.ToString());
774Assert.Equal(text, statement.ToString());
780Assert.Equal("ref T", ds.Declaration.Type.ToString());
800Assert.Equal(text, statement.ToString());
806Assert.Equal("ref T", ds.Declaration.Type.ToString());
817Assert.Equal("ref b", initializer.Value.ToString());
831Assert.Equal(text, statement.ToString());
837Assert.Equal("ref T", ds.Declaration.Type.ToString());
848Assert.Equal("ref b", initializer.Value.ToString());
858Assert.Equal("ref d", initializer.Value.ToString());
872Assert.Equal(text, statement.ToString());
883Assert.Equal("T", fs.Declaration.Type.ToString());
885Assert.Equal("a = b", fs.Declaration.Variables[0].ToString());
888Assert.Equal("{ }", fs.Statement.ToString());
899Assert.Equal(text, statement.ToString());
910Assert.Equal("var", fs.Declaration.Type.ToString());
915Assert.Equal("a = b", fs.Declaration.Variables[0].ToString());
918Assert.Equal("{ }", fs.Statement.ToString());
929Assert.Equal(text, statement.ToString());
940Assert.Equal("T", fs.Declaration.Type.ToString());
942Assert.Equal("a = b", fs.Declaration.Variables[0].ToString());
943Assert.Equal("c = d", fs.Declaration.Variables[1].ToString());
946Assert.Equal("{ }", fs.Statement.ToString());
957Assert.Equal(text, statement.ToString());
973Assert.Equal(text, statement.ToString());
983Assert.Equal(";", ls.Statement.ToString());
994Assert.Equal(text, statement.ToString());
1013Assert.Equal(text, statement.ToString());
1032Assert.Equal(text, statement.ToString());
1041Assert.Equal("label", gs.Expression.ToString());
1054Assert.Equal(text, statement.ToString());
1065Assert.Equal("label", gs.Expression.ToString());
1078Assert.Equal(text, statement.ToString());
1101Assert.Equal(text, statement.ToString());
1121Assert.Equal(text, statement.ToString());
1129Assert.Equal("a", rs.Expression.ToString());
1142Assert.Equal(text, statement.ToString());
1153Assert.Equal("a", ys.Expression.ToString());
1166Assert.Equal(text, statement.ToString());
1189Assert.Equal(text, statement.ToString());
1209Assert.Equal(text, statement.ToString());
1217Assert.Equal("a", ts.Expression.ToString());
1230Assert.Equal(text, statement.ToString());
1243Assert.Equal("T", ts.Catches[0].Declaration.Type.ToString());
1260Assert.Equal(text, statement.ToString());
1273Assert.Equal("T", ts.Catches[0].Declaration.Type.ToString());
1289Assert.Equal(text, statement.ToString());
1313Assert.Equal(text, statement.ToString());
1327Assert.Equal("T", ts.Catches[0].Declaration.Type.ToString());
1337Assert.Equal("T2", ts.Catches[1].Declaration.Type.ToString());
1356Assert.Equal(text, statement.ToString());
1379Assert.Equal(text, statement.ToString());
1393Assert.Equal("T", ts.Catches[0].Declaration.Type.ToString());
1403Assert.Equal("T2", ts.Catches[1].Declaration.Type.ToString());
1424Assert.Equal(text, statement.ToString());
1441Assert.Equal(text, statement.ToString());
1458Assert.Equal(text, statement.ToString());
1475Assert.Equal(text, statement.ToString());
1484Assert.Equal("a", ws.Condition.ToString());
1497Assert.Equal(text, statement.ToString());
1510Assert.Equal("a", ds.Condition.ToString());
1522Assert.Equal(text, statement.ToString());
1548Assert.Equal(text, statement.ToString());
1559Assert.Equal("T", fs.Declaration.Type.ToString());
1566Assert.Equal("0", fs.Declaration.Variables[0].Initializer.Value.ToString());
1585Assert.Equal(text, statement.ToString());
1596Assert.Equal("var", fs.Declaration.Type.ToString());
1605Assert.Equal("0", fs.Declaration.Variables[0].Initializer.Value.ToString());
1624Assert.Equal(text, statement.ToString());
1635Assert.Equal("T", fs.Declaration.Type.ToString());
1643Assert.Equal("0", fs.Declaration.Variables[0].Initializer.Value.ToString());
1650Assert.Equal("1", fs.Declaration.Variables[1].Initializer.Value.ToString());
1733Assert.Equal(text, statement.ToString());
1744Assert.Equal("a = 0", fs.Initializers[0].ToString());
1762Assert.Equal(text, statement.ToString());
1773Assert.Equal("a = 0", fs.Initializers[0].ToString());
1774Assert.Equal("b = 1", fs.Initializers[1].ToString());
1792Assert.Equal(text, statement.ToString());
1806Assert.Equal("a", fs.Condition.ToString());
1822Assert.Equal(text, statement.ToString());
1838Assert.Equal("a++", fs.Incrementors[0].ToString());
1852Assert.Equal(text, statement.ToString());
1868Assert.Equal("a++", fs.Incrementors[0].ToString());
1869Assert.Equal("b++", fs.Incrementors[1].ToString());
1883Assert.Equal(text, statement.ToString());
1894Assert.Equal("T", fs.Declaration.Type.ToString());
1901Assert.Equal("0", fs.Declaration.Variables[0].Initializer.Value.ToString());
1907Assert.Equal("a < 10", fs.Condition.ToString());
1912Assert.Equal("a++", fs.Incrementors[0].ToString());
1926Assert.Equal(text, statement.ToString());
1935Assert.Equal("T", fs.Type.ToString());
1942Assert.Equal("b", fs.Expression.ToString());
1955Assert.Equal(text, statement.ToString());
1968Assert.Equal("T", fs.Type.ToString());
1975Assert.Equal("b", fs.Expression.ToString());
1988Assert.Equal(text, statement.ToString());
1997Assert.Equal("var", fs.Type.ToString());
2006Assert.Equal("b", fs.Expression.ToString());
2019Assert.Equal(text, statement.ToString());
2027Assert.Equal("a", ss.Condition.ToString());
2042Assert.Equal(text, statement.ToString());
2050Assert.Equal("a", ss.Condition.ToString());
2068Assert.Equal(text, statement.ToString());
2076Assert.Equal("a", ss.Condition.ToString());
2089Assert.Equal("b", subIf.Condition.ToString());
2102Assert.Equal(text, statement.ToString());
2110Assert.Equal("a", ls.Expression.ToString());
2123Assert.Equal(text, statement.ToString());
2133Assert.Equal("a", ss.Expression.ToString());
2148Assert.Equal(text, statement.ToString());
2156Assert.Equal("a", ss.Expression.ToString());
2167Assert.Equal("b", caseLabelSyntax.Value.ToString());
2170Assert.Equal(";", ss.Sections[0].Statements[0].ToString());
2183Assert.Equal(text, statement.ToString());
2191Assert.Equal("a", ss.Expression.ToString());
2203Assert.Equal("b", caseLabelSyntax.Value.ToString());
2206Assert.Equal(";", ss.Sections[0].Statements[0].ToString());
2214Assert.Equal("c", caseLabelSyntax2.Value.ToString());
2217Assert.Equal(";", ss.Sections[0].Statements[0].ToString());
2230Assert.Equal(text, statement.ToString());
2238Assert.Equal("a", ss.Expression.ToString());
2250Assert.Equal(";", ss.Sections[0].Statements[0].ToString());
2263Assert.Equal(text, statement.ToString());
2271Assert.Equal("a", ss.Expression.ToString());
2283Assert.Equal("b", caseLabelSyntax.Value.ToString());
2289Assert.Equal("c", caseLabelSyntax2.Value.ToString());
2292Assert.Equal(";", ss.Sections[0].Statements[0].ToString());
2305Assert.Equal(text, statement.ToString());
2313Assert.Equal("a", ss.Expression.ToString());
2325Assert.Equal("b", caseLabelSyntax.Value.ToString());
2327Assert.Equal("s1();", ss.Sections[0].Statements[0].ToString());
2328Assert.Equal("s2();", ss.Sections[0].Statements[1].ToString());
2341Assert.Equal(text, statement.ToString());
2350Assert.Equal("a", us.Expression.ToString());
2363Assert.Equal(text, statement.ToString());
2373Assert.Equal("T", us.Declaration.Type.ToString());
2381Assert.Equal("b", us.Declaration.Variables[0].Initializer.Value.ToString());
2397Assert.Equal(text, statement.ToString());
2406Assert.Equal("T", us.Declaration.Type.ToString());
2414Assert.Equal("b", us.Declaration.Variables[0].Initializer.Value.ToString());
2456Assert.Equal(text, statement.ToString());
2466Assert.Equal("var", us.Declaration.Type.ToString());
2476Assert.Equal("b", us.Declaration.Variables[0].Initializer.Value.ToString());
2492Assert.Equal(text, statement.ToString());
2501Assert.Equal("var", us.Declaration.Type.ToString());
2511Assert.Equal("b", us.Declaration.Variables[0].Initializer.Value.ToString());
2624Assert.Equal(text, statement.ToString());
2635Assert.Equal("var", us.Declaration.Type.ToString());
2645Assert.Equal("b", us.Declaration.Variables[0].Initializer.Value.ToString());
2796Assert.Equal(text, statement.ToString());
2806Assert.Equal("T", us.Declaration.Type.ToString());
2816Assert.Equal("b", us.Declaration.Variables[0].Initializer.Value.ToString());
2824Assert.Equal("d", us.Declaration.Variables[1].Initializer.Value.ToString());
2840Assert.Equal(text, statement.ToString());
2849Assert.Equal("T", us.Declaration.Type.ToString());
2859Assert.Equal("b", us.Declaration.Variables[0].Initializer.Value.ToString());
2867Assert.Equal("d", us.Declaration.Variables[1].Initializer.Value.ToString());
2921Assert.Equal(text, statement.ToString());
2930Assert.Equal("f ? x = a : x = b", us.Expression.ToString());
2943Assert.Equal(text, statement.ToString());
2950Assert.Equal("var x = f ? a : b", us.Declaration.ToString());
3004Assert.Equal(text, statement.ToString());
3012Assert.Equal("f ? x = a", us.Declaration.ToString());
3026Assert.Equal(text, statement.ToString());
3033Assert.Equal("f ? x = a", us.Declaration.ToString());
3076Assert.Equal(text, statement.ToString());
3084Assert.Equal("f ? x, y", us.Declaration.ToString());
3098Assert.Equal(text, statement.ToString());
3105Assert.Equal("f ? x, y", us.Declaration.ToString());
3346Assert.Equal(text, statement.ToString());
3349Assert.Equal(keywordText, decl.Declaration.Type.ToString());
3374Assert.Equal(text, statement.ToString());
3383Assert.Equal("T", fs.Type.ToString());
3390Assert.Equal("b", fs.Expression.ToString());
3554Assert.Equal(text, statement.ToString());
Syntax\SyntaxNodeTests.cs (35)
56var text = qname2.ToString();
126Assert.Equal("(d / e)", firstParens.ToString());
526Assert.Equal(identifierNodes[i].ToString(), nodesWithMyAnnotations[i].ToString());
1781Assert.Equal(rootNode.Span.Length, rootNode.ToString().Length);
1782Assert.True(rootNode.ToString().Contains("/*END*/"));
1783Assert.False(rootNode.ToString().Contains("/*START*/"));
1799Assert.Equal(rootNode.Span.Length, rootNode.ToString().Length);
1800Assert.True(rootNode.ToString().Contains("/*END*/"));
1801Assert.False(rootNode.ToString().Contains("/*START*/"));
1862Assert.Equal("Goo.Bar", qualified.ToString());
1867Assert.Equal("Bar<int>", generic.ToString());
1872Assert.Equal("Goo.Bar<int>", qualifiedGeneric.ToString());
1877Assert.Equal("alias::Goo", alias.ToString());
1882Assert.Equal("alias::Bar<int>", aliasGeneric.ToString());
1887Assert.Equal("alias::Goo.Bar", aliasQualified.ToString());
1892Assert.Equal("alias::Goo.Bar<int>", aliasQualifiedGeneric.ToString());
2256Assert.Equal("a + c", expr2.ToString());
3561Assert.Equal("class A { }", node.ToString());
3894var withAsync = expression.WithAsyncKeyword(SyntaxFactory.Token(SyntaxKind.AsyncKeyword).WithTrailingTrivia(SyntaxFactory.Space)).ToString();
3903var withAsync = expression.WithAsyncKeyword(SyntaxFactory.Token(SyntaxKind.AsyncKeyword).WithTrailingTrivia(SyntaxFactory.Space)).ToString();
3912var withAsync = expression.WithAsyncKeyword(SyntaxFactory.Token(SyntaxKind.AsyncKeyword).WithTrailingTrivia(SyntaxFactory.Space)).ToString();
3921var withAsync = expression.WithAsyncKeyword(SyntaxFactory.Token(SyntaxKind.AsyncKeyword).WithTrailingTrivia(SyntaxFactory.Space)).ToString();
3930var withAsync = expression.WithAsyncKeyword(SyntaxFactory.Token(SyntaxKind.AsyncKeyword).WithTrailingTrivia(SyntaxFactory.Space)).ToString();
3939var withAsync = expression.WithAsyncKeyword(SyntaxFactory.Token(SyntaxKind.AsyncKeyword).WithTrailingTrivia(SyntaxFactory.Space)).ToString();
3948var withAsync = expression.WithAsyncKeyword(default).ToString();
3957var withAsync = expression.WithAsyncKeyword(default).ToString();
3966var withAsync = expression.WithAsyncKeyword(default).ToString();
3975var withAsync = expression.WithAsyncKeyword(default).ToString();
3984var withAsync = expression.WithAsyncKeyword(default).ToString();
3993var withAsync = expression.WithAsyncKeyword(default).ToString();
4003var withAsync = expression.WithAsyncKeyword(newAsync).ToString();
4013Assert.Equal("static delegate(int i) { }", withAsync.ToString());
4041var newExpression = expression.Update(replacedKeyword, expression.Type).ToString();
4053Assert.Equal("string s", newParameter.ToString());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (56)
CodeGeneration\SyntaxGeneratorTests.cs (56)
3194Assert.Equal("t", Generator.GetType(Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"))).ToString());
3197Assert.Equal("t", Generator.GetType(Generator.FieldDeclaration("f", Generator.IdentifierName("t"))).ToString());
3198Assert.Equal("t", Generator.GetType(Generator.PropertyDeclaration("p", 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());
3208Assert.Equal("t", Generator.GetType(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "v")).ToString());
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());
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());
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());
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());
3302Assert.Equal("x", Generator.GetExpression(method).ToString());
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());
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());
3338Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(method, Generator.IdentifierName("y"))).ToString());
3345Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(local, Generator.IdentifierName("y"))).ToString());
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());
3523Assert.Equal("p * 10", Generator.GetExpression(y).ToString());
3526Assert.Equal("500", Generator.GetExpression(Generator.WithExpression(y, Generator.LiteralExpression(500))).ToString());
3645Assert.Equal("B", baseListBI[0].ToString());
3646Assert.Equal("I", baseListBI[1].ToString());
3656Assert.Equal("B", baseListB[0].ToString());
3797Assert.Equal("int", Generator.GetType(declX).ToString());
3803Assert.Equal("int", Generator.GetType(declY).ToString());
3809Assert.Equal("int", Generator.GetType(declZ).ToString());
3817Assert.Equal("T", Generator.GetType(xTypedT).ToString());
3827Assert.Equal("e", Generator.GetExpression(xInitialized).ToString());
3843Assert.Equal("[A]", Generator.GetAttributes(xAttributed)[0].ToString());
4145Assert.Equal("[Q]", xNamedQ.ToString());
4150Assert.Equal("[X(e)]", xWithArg.ToString());
4325Assert.Equal("[Q]", xNamedQ.ToString());
4330Assert.Equal("[X(e)]", xWithArg.ToString());
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Microsoft.CodeAnalysis.Features (6)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
301id = idNode.ToString();
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
Microsoft.CodeAnalysis.Test.Utilities (9)
Microsoft.CodeAnalysis.UnitTests (4)
Microsoft.CodeAnalysis.VisualBasic (2)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (1)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (2)
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
Microsoft.CodeAnalysis.VisualBasic.Features (11)
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (2)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (44)
Compilation\SemanticModelAPITests.vb (13)
114Assert.Equal("c1", expr1.ToString())
154Assert.Equal("c1", expr1.ToString())
539Assert.Equal("System.Collections.Generic.List(Of T)", node.ToString())
884Assert.Equal("Dim x = N.A.X", originalStatement.ToString())
1909Assert.Equal("I.Method", implementsName.ToString())
2453Assert.Equal("0", expr1.ToString())
2484Assert.Equal("chary", expr2.ToString())
2497Assert.Equal("str", expr2.ToString())
2580Assert.Equal("0", expr1.ToString())
2609Assert.Equal("chary", expr2.ToString())
2622Assert.Equal("str", expr2.ToString())
2855Assert.Equal("d1", id.ToString())
2868Assert.Equal("d2", id.ToString())
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (10)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (80)
Parser\ParseDirectives.vb (13)
1653Assert.Equal("[BC42024]", enableNode.ErrorCodes(0).ToString)
1662Assert.Equal("disable", disableNode.ErrorCodes(0).ToString)
2122Assert.Equal("[Rem]", enableNode.ErrorCodes(1).ToString)
2148Assert.Equal("BC&", enableNode.ErrorCodes(1).ToString)
2215Assert.Equal("BC&", disableNode.ErrorCodes(4).ToString)
2269Assert.Equal("True", disableNode.ErrorCodes(0).ToString)
2272Assert.Equal("False", disableNode.ErrorCodes(1).ToString)
2275Assert.Equal(String.Empty, disableNode.ErrorCodes(2).ToString)
2278Assert.Equal("Nothing", disableNode.ErrorCodes(3).ToString)
2305Assert.Equal("Chr", disableNode.ErrorCodes(2).ToString)
2329Assert.Equal("string", disableNode.ErrorCodes(0).ToString)
2332Assert.Equal("bc42024", disableNode.ErrorCodes(1).ToString)
2335Assert.Equal(String.Empty, disableNode.ErrorCodes(2).ToString)
TestSyntaxNodes.vb (42)
584Assert.Equal("( )", arglist.ToString)
592Assert.Equal("goo", seplist(0).ToString)
610Assert.Equal("Inherits goo", statement.ToString)
632Assert.Equal("aaa", sepList(0).ToString)
633Assert.Equal("bbb", sepList(1).ToString)
634Assert.Equal("cc", sepList(2).ToString)
645Assert.Equal("Inherits aaa , bbb ; cc", statement.ToString)
656Assert.Equal("aaa", sepList(0).ToString)
657Assert.Equal("bbb", sepList(1).ToString)
658Assert.Equal("cc", sepList(2).ToString)
898methodStatement.ToString())
1201Assert.Equal(simpleTree.ToString, "1- X( 3, 4+ 8, 9)")
1211Assert.Equal(newTree.ToString, "2- X( 4, 5+ 9, 10)")
1214Assert.Equal("public Overloads SUB MySub ( ByVal Param1 As Integer , ByVal Param2 As String , ByRef Param3 As Double )", methodStmt.ToString)
1224Assert.Equal("PUBLIC OVERLOADS SUB MySub ( BYVAL Param1 AS INTEGER , BYVAL Param2 AS STRING , BYREF Param3 AS DOUBLE )", newMethod.ToString)
1229Assert.Equal("public Overloads SUB MYSUB ( ByVal PARAM1 As Integer , ByVal PARAM2 As String , ByRef PARAM3 As Double )", newMethod.ToString)
1234Assert.Equal("public Overloads SUB MySub ( ByVal Param2 As String , ByVal Param1 As Integer , ByRef Param3 As Double )", newMethod.ToString)
1239Assert.Equal("PUBLIC OVERLOADS SUB MYSUB ( BYVAL PARAM2 AS STRING , BYVAL PARAM1 AS INTEGER , BYREF PARAM3 AS DOUBLE )", newMethod.ToString)
1245Assert.Equal("1- X( 3, 4+ 8, 9)", simpleTree.ToString)
1249Assert.Equal("""Hi""- X( 3, 4+ 8, 9)", simpleTree.ToString)
1253Assert.Equal("""Hi""- X( 3, 4+ 8, 9)", simpleTree.ToString)
1477Assert.Equal("a + c", expr2.ToString())
1788Assert.Equal("<goo> </ >", xmlElement.ToString)
1792Assert.Equal("<goo> </ >", docComment.ToString)
1794Assert.Equal("<goo> </ >", docComment.Content(0).ToString)
1796Assert.Equal("<goo>", DirectCast(docComment.Content(0), XmlElementSyntax).StartTag.ToString)
2048Assert.Equal("#const x =1", fDir.ToString)
2051Assert.Equal("#const y = 2", lDir.ToString)
2053Dim fDir1 = mDecl.GetFirstDirective(Function(d) d.ToString = "#const y = 2")
2054Assert.Equal("#const y = 2", fDir1.ToString)
2055fDir1 = mDecl.GetFirstDirective(Function(d) d.ToString = "#const y = 42")
2058Dim lDir1 = mDecl.GetLastDirective(Function(d) d.ToString = "#const x =1")
2059Assert.Equal("#const x =1", lDir1.ToString)
2060lDir1 = mDecl.GetLastDirective(Function(d) d.ToString = "#const x =42")
2080Assert.Equal("#const y = 2", fDir1.ToString)
2084Assert.Equal("#const y = 2", lDir1.ToString)
2086Dim fDir2 = fDir1.GetNextDirective(Function(d) d.ToString = "#const y = 3")
2087Assert.Equal("#const y = 3", fDir2.ToString)
2088fDir2 = fDir1.GetNextDirective(Function(d) d.ToString = "#const y = 42")
2091Dim lDir2 = lDir1.GetPreviousDirective(Function(d) d.ToString = "#const x =1")
2092Assert.Equal("#const x =1", lDir2.ToString)
2093lDir2 = lDir1.GetPreviousDirective(Function(d) d.ToString = "#const x =42")
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (6)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (10)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (52)
CodeGeneration\SyntaxGeneratorTests.vb (51)
2764Assert.Equal("t", Generator.GetType(Generator.MethodDeclaration("m", returnType:=Generator.IdentifierName("t"))).ToString())
2767Assert.Equal("t", Generator.GetType(Generator.FieldDeclaration("f", Generator.IdentifierName("t"))).ToString())
2768Assert.Equal("t", Generator.GetType(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))).ToString())
2769Assert.Equal("t", Generator.GetType(Generator.IndexerDeclaration({Generator.ParameterDeclaration("p", Generator.IdentifierName("pt"))}, Generator.IdentifierName("t"))).ToString())
2770Assert.Equal("t", Generator.GetType(Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))).ToString())
2772Assert.Equal("t", Generator.GetType(Generator.EventDeclaration("ef", Generator.IdentifierName("t"))).ToString())
2773Assert.Equal("t", Generator.GetType(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"))).ToString())
2775Assert.Equal("t", Generator.GetType(Generator.DelegateDeclaration("t", returnType:=Generator.IdentifierName("t"))).ToString())
2778Assert.Equal("t", Generator.GetType(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "v")).ToString())
2786Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.MethodDeclaration("m", returnType:=Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2787Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.MethodDeclaration("m"), Generator.IdentifierName("t"))).ToString())
2788Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.FieldDeclaration("f", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2789Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.PropertyDeclaration("p", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2790Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.IndexerDeclaration({Generator.ParameterDeclaration("p", Generator.IdentifierName("pt"))}, Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2791Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.ParameterDeclaration("p", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2793Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.DelegateDeclaration("t", returnType:=Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2794Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.DelegateDeclaration("t"), Generator.IdentifierName("t"))).ToString())
2796Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.EventDeclaration("ef", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2797Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString())
2799Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.LocalDeclarationStatement(Generator.IdentifierName("x"), "v"), Generator.IdentifierName("t"))).ToString())
2881Assert.Equal("x", Generator.GetExpression(Generator.FieldDeclaration("f", Generator.IdentifierName("t"), initializer:=Generator.IdentifierName("x"))).ToString())
2882Assert.Equal("x", Generator.GetExpression(Generator.ParameterDeclaration("p", Generator.IdentifierName("t"), initializer:=Generator.IdentifierName("x"))).ToString())
2883Assert.Equal("x", Generator.GetExpression(Generator.LocalDeclarationStatement("loc", initializer:=Generator.IdentifierName("x"))).ToString())
2888Assert.Equal("x", Generator.GetExpression(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("x"))).ToString())
2889Assert.Equal("x", Generator.GetExpression(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("x"))).ToString())
2890Assert.Equal("x", Generator.GetExpression(Generator.ValueReturningLambdaExpression("p", Generator.IdentifierName("x"))).ToString())
2891Assert.Equal("x", Generator.GetExpression(Generator.VoidReturningLambdaExpression("p", Generator.IdentifierName("x"))).ToString())
2899Assert.Equal("x", Generator.GetExpression(Generator.WithExpression(Generator.FieldDeclaration("f", Generator.IdentifierName("t")), Generator.IdentifierName("x"))).ToString())
2900Assert.Equal("x", Generator.GetExpression(Generator.WithExpression(Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.IdentifierName("x"))).ToString())
2901Assert.Equal("x", Generator.GetExpression(Generator.WithExpression(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc"), Generator.IdentifierName("x"))).ToString())
2904Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.ValueReturningLambdaExpression("p", {Generator.IdentifierName("x")}), Generator.IdentifierName("y"))).ToString())
2905Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.VoidReturningLambdaExpression("p", {Generator.IdentifierName("x")}), Generator.IdentifierName("y"))).ToString())
2906Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.ValueReturningLambdaExpression({Generator.IdentifierName("x")}), Generator.IdentifierName("y"))).ToString())
2907Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.VoidReturningLambdaExpression({Generator.IdentifierName("x")}), Generator.IdentifierName("y"))).ToString())
2908Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.ValueReturningLambdaExpression("p", Generator.IdentifierName("x")), Generator.IdentifierName("y"))).ToString())
2909Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.VoidReturningLambdaExpression("p", Generator.IdentifierName("x")), Generator.IdentifierName("y"))).ToString())
2910Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("x")), Generator.IdentifierName("y"))).ToString())
2911Assert.Equal("y", Generator.GetExpression(Generator.WithExpression(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("x")), Generator.IdentifierName("y"))).ToString())
3208Assert.Equal("B", baseListBI(0).ToString())
3209Assert.Equal("I", baseListBI(1).ToString())
3220Assert.Equal("X", baseListXY(0).ToString())
3221Assert.Equal("Y", baseListXY(1).ToString())
3488Assert.Equal("Integer", Generator.GetType(declX).ToString())
3494Assert.Equal("Integer", Generator.GetType(declY).ToString())
3500Assert.Equal("Integer", Generator.GetType(declZ).ToString())
3508Assert.Equal("T", Generator.GetType(xTypedT).ToString())
3518Assert.Equal("e", Generator.GetExpression(xInitialized).ToString())
3534Assert.Equal("<A>", Generator.GetAttributes(xAttributed)(0).ToString())
3745Assert.Equal("<Q>", xNamedQ.ToString())
3750Assert.Equal("<X(e)>", xWithArg.ToString())
3871Assert.Equal("Imports Q", xRenamedQ.ToString())
Microsoft.CodeAnalysis.Workspaces (2)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
Microsoft.CodeAnalysis.Workspaces.UnitTests (7)
Microsoft.DotNet.CodeAnalysis (1)
Microsoft.Extensions.Logging.Generators (1)
Microsoft.Gen.ContextualOptions.Unit.Tests (2)
Microsoft.Gen.Logging (1)
Microsoft.Gen.Metrics (1)
Microsoft.Gen.MetricsReports (1)
Microsoft.Interop.SourceGeneration (4)
Microsoft.ML.InternalCodeAnalyzer (9)
Microsoft.VisualStudio.LanguageServices.CSharp (22)
Microsoft.VisualStudio.LanguageServices.VisualBasic (25)
System.Private.CoreLib.Generators (1)
System.Windows.Forms.Analyzers.CodeFixes.CSharp (2)
System.Windows.Forms.Analyzers.CSharp (1)