156 references to ToTestDisplayString
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (9)
CodeGen\CodeGenDeconstructTests.cs (1)
5609
Assert.Equal("var", xType.
ToTestDisplayString
());
CodeGen\CodeGenTupleTest.cs (8)
943
Assert.Equal("(System.Int32 e1, System.Int32)", partialNames.TypeWithAnnotations.
ToTestDisplayString
());
948
Assert.Equal("(System.Int32, System.Int32)", allNullNames.TypeWithAnnotations.
ToTestDisplayString
());
954
Assert.Equal("System.ValueTuple<(System.Int32 e1, System.Int32)>", partialParamType.
ToTestDisplayString
());
960
Assert.Equal("System.ValueTuple<(System.Int32, System.Int32)>", allNullParamType.
ToTestDisplayString
());
1620
Assert.Equal(new[] { "System.Int32", "System.String" }, xSymbol.TupleElementTypesWithAnnotations.SelectAsArray(t => t.
ToTestDisplayString
()));
11210
Assert.Equal(new[] { "System.Int32", "System.Int32" }, m1Tuple.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Select(t => t.
ToTestDisplayString
()));
22284
Assert.Equal("(System.Int32, System.Int32)[missing]", methodM.ReturnTypeWithAnnotations.
ToTestDisplayString
());
22324
Assert.Equal("(System.Int32 Item1, System.Int32 Bob)[missing]", methodM.ReturnTypeWithAnnotations.
ToTestDisplayString
());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (28)
Attributes\AttributeTests_Dynamic.cs (1)
538
Assert.Equal("System.Boolean[]", dynamicAttribute.AttributeConstructor.Parameters.Single().TypeWithAnnotations.
ToTestDisplayString
());
Attributes\AttributeTests_NativeInteger.cs (1)
1499
Assert.Equal("System.Boolean[]", field.TypeWithAnnotations.
ToTestDisplayString
());
Attributes\AttributeTests_Nullable.cs (12)
1391
Assert.Equal("A?", type.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
1393
Assert.Equal("A!", type.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
1438
Assert.Equal("A<System.Object>", type.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
1499
Assert.Equal("A<System.Object?>!", type.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
1501
Assert.Equal("A<System.Object!>!", type.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
1550
Assert.Equal("T?", type.TypeParameters[1].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
4827
type.GetMember<FieldSymbol>("Nested").TypeWithAnnotations.
ToTestDisplayString
());
4830
type.GetMember<FieldSymbol>("Long").TypeWithAnnotations.
ToTestDisplayString
());
4945
type.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
());
4948
type.GetMember<FieldSymbol>("Field").TypeWithAnnotations.
ToTestDisplayString
());
4951
type.GetMember<EventSymbol>("Event").TypeWithAnnotations.
ToTestDisplayString
());
5003
Assert.Equal("System.Byte[]", field.TypeWithAnnotations.
ToTestDisplayString
());
Attributes\AttributeTests_Synthesized.cs (2)
65
Assert.Equal("System.Int32", attribute.AttributeConstructor.Parameters.Single().TypeWithAnnotations.
ToTestDisplayString
());
93
Assert.Equal("System.Diagnostics.DebuggableAttribute.DebuggingModes", attribute.AttributeConstructor.Parameters.Single().TypeWithAnnotations.
ToTestDisplayString
());
Attributes\AttributeTests_Tuples.cs (1)
629
Assert.Equal("System.String[]", tupleAttr.AttributeConstructor.Parameters.Single().TypeWithAnnotations.
ToTestDisplayString
());
FieldKeywordTests.cs (1)
11702
Assert.Equal("System.Int32?", sourceField.TypeWithAnnotations.
ToTestDisplayString
());
RefStructInterfacesTests.cs (8)
4958
Assert.Equal("I1", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
());
4985
Assert.Equal("I1", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
());
5016
Assert.Equal("C1", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
());
5070
Assert.Equal("System.Enum", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
());
5517
Assert.Equal("C", t1.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
());
5522
Assert.Equal("C", t2.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
());
5646
Assert.Equal("C", t1.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
());
5651
Assert.Equal("C", t2.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
());
Semantics\ExtensionTests.cs (2)
4342
AssertEx.Equal("System.String?", extensions[0].ExtensionParameter.TypeWithAnnotations.
ToTestDisplayString
());
4343
AssertEx.Equal("System.String?", extensions[1].ExtensionParameter.TypeWithAnnotations.
ToTestDisplayString
());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (110)
Semantics\ForEachTests.cs (2)
2154
Assert.Equal("C.var", info.ElementTypeWithAnnotations.
ToTestDisplayString
());
2165
Assert.Equal("C.var", boundNode.IterationVariables.Single().TypeWithAnnotations.
ToTestDisplayString
());
Semantics\IteratorTests.cs (3)
43
Assert.Equal("System.Int32", i.IteratorElementTypeWithAnnotations.
ToTestDisplayString
());
49
Assert.Equal("System.Int32", i.IteratorElementTypeWithAnnotations.
ToTestDisplayString
());
92
Assert.Equal("System.Int32", i.IteratorElementTypeWithAnnotations.
ToTestDisplayString
());
Semantics\LocalFunctionTests.cs (2)
2370
Assert.Equal("System.Int32", local.IteratorElementTypeWithAnnotations.
ToTestDisplayString
());
2376
Assert.Equal("System.Int32", local.IteratorElementTypeWithAnnotations.
ToTestDisplayString
());
Semantics\NullableReferenceTypesTests.cs (103)
11206
Assert.Equal(displayName, type.
ToTestDisplayString
(true));
11309
Assert.Equal(displayName, type.
ToTestDisplayString
(true));
13858
Assert.Equal("C<System.String? modopt(System.Runtime.CompilerServices.IsConst), System.String>", m1.OverriddenMethod.ReturnTypeWithAnnotations.
ToTestDisplayString
());
13859
Assert.Equal("C<System.String modopt(System.Runtime.CompilerServices.IsConst), System.String?>", m1.ReturnTypeWithAnnotations.
ToTestDisplayString
());
59102
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59136
Assert.Equal("System.String", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59164
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59196
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59225
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59258
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59290
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59323
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59357
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59384
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59414
Assert.Equal("var?", type.
ToTestDisplayString
());
59442
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59446
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59450
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
71360
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71363
Assert.Equal("System.Int32", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71396
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71399
Assert.Equal("System.Int32?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71437
Assert.Equal("T?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71440
Assert.Equal("T?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71474
Assert.Equal("T?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71477
Assert.Equal("T?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71511
Assert.Equal("System.String!", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71514
Assert.Equal("System.Int32", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71546
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71549
Assert.Equal("System.Int32?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71579
Assert.Equal("T", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71616
Assert.Equal("T!", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71619
Assert.Equal("T?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
81362
Assert.Equal("System.String!", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
111649
Assert.Equal("A1", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111651
Assert.Equal("A2<System.Object>", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111693
Assert.Equal("A1", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111694
Assert.Equal("A1?", typeParameters[1].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111696
Assert.Equal("A2<System.Object>", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111697
Assert.Equal("A2<System.Object?>", typeParameters[1].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111837
AssertEx.Equal(expectedTypes, constraintTypes.SelectAsArray(t => t.
ToTestDisplayString
(true)));
111902
AssertEx.Equal(expectedConstraintTypes, constraintTypes.SelectAsArray(t => t.
ToTestDisplayString
(true)));
111955
AssertEx.Equal(expectedConstraintTypes, constraintTypes.SelectAsArray(t => t.
ToTestDisplayString
(true)));
111998
Assert.Equal("I<T>", constraintTypes[0].
ToTestDisplayString
(true));
112729
Assert.Equal(expected, constraintType.
ToTestDisplayString
());
112818
Assert.Equal(expected, constraintType.
ToTestDisplayString
());
113308
Assert.Equal("B[]", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113311
Assert.Equal("C![]!", f2.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113357
Assert.Equal("B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113386
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113423
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113454
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113495
Assert.Equal("System.String!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113517
Assert.Equal("System.String", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113547
Assert.Equal("B[]!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113572
Assert.Equal("B![]", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113657
Assert.Equal("B<A>!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113682
Assert.Equal("B<A!>", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113718
Assert.Equal("var!", model.GetDeclaredSymbol(decl.Designation).GetSymbol<LocalSymbol>().TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113749
Assert.Equal("var", model.GetDeclaredSymbol(decl.Designation).GetSymbol<LocalSymbol>().TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114373
Assert.Equal("C!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114398
Assert.Equal("C", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114431
Assert.Equal("C.B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114459
Assert.Equal("C.B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114492
Assert.Equal("C.B<A>!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114520
Assert.Equal("C.B<A!>", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114550
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114586
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114623
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114659
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114689
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114721
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114752
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114783
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114813
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114844
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114874
Assert.Equal("B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114903
Assert.Equal("B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
124038
Assert.Equal(baseline[i].type, f.TypeWithAnnotations.
ToTestDisplayString
(true));
137109
Assert.Equal("System.IEquatable<T>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137143
Assert.Equal("System.IEquatable<T?>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137171
Assert.Equal("System.IEquatable<T>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137207
Assert.Equal("System.IEquatable<System.String?>?", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137382
Assert.Equal("System.IEquatable<T>?", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137407
Assert.Equal("System.IEquatable<T>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137437
Assert.Equal("System.IEquatable<T!>?", t.ConstraintTypesNoUseSiteDiagnostics[i].
ToTestDisplayString
(true));
137438
Assert.Equal("System.IEquatable<System.String?>!", t.ConstraintTypesNoUseSiteDiagnostics[j].
ToTestDisplayString
(true));
137486
Assert.Equal("I1<System.String?, System.String>", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137492
Assert.Equal("I1<System.String, System.String?>", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137498
Assert.Equal("I1<System.String, System.String>?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137528
Assert.Equal("I1<System.String?, System.String?>?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137569
Assert.Equal("I1?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137570
Assert.Equal("I2?", t.ConstraintTypesNoUseSiteDiagnostics[1].
ToTestDisplayString
(true));
137610
Assert.Equal("I1!", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137611
Assert.Equal("I2!", t.ConstraintTypesNoUseSiteDiagnostics[1].
ToTestDisplayString
(true));
137649
Assert.Equal("I1?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137650
Assert.Equal("I2?", t.ConstraintTypesNoUseSiteDiagnostics[1].
ToTestDisplayString
(true));
137688
Assert.Equal("I1!", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137689
Assert.Equal("I2!", t.ConstraintTypesNoUseSiteDiagnostics[1].
ToTestDisplayString
(true));
138887
Assert.Equal("System.IEquatable<T>!", f.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
138888
Assert.Equal("System.IEquatable<T>", f.PartialImplementationPart.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
138912
Assert.Equal("System.IEquatable<T?>!", f.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
138914
Assert.Equal("System.IEquatable<T>", f.PartialImplementationPart.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (8)
Symbols\Metadata\PE\NoPia.cs (1)
1255
Assert.Equal("System.Collections.Generic.List<I1>", varI7_Bar.ReturnTypeWithAnnotations.
ToTestDisplayString
());
Symbols\Source\EventTests.cs (4)
355
Assert.Equal("System.Action<dynamic>", e1.AddMethod.ParameterTypesWithAnnotations[0].
ToTestDisplayString
());
358
Assert.Equal("System.Action<dynamic>", e1.RemoveMethod.ParameterTypesWithAnnotations[0].
ToTestDisplayString
());
361
Assert.Equal("System.Action<dynamic>", e2.AddMethod.ParameterTypesWithAnnotations[0].
ToTestDisplayString
());
364
Assert.Equal("System.Action<dynamic>", e2.RemoveMethod.ParameterTypesWithAnnotations[0].
ToTestDisplayString
());
Symbols\StaticAbstractMembersInInterfacesTests.cs (3)
27720
Assert.Equal("System.Void", c3M02Remove.ReturnTypeWithAnnotations.
ToTestDisplayString
());
27789
Assert.Equal("System.Void", c4M02Add.ReturnTypeWithAnnotations.
ToTestDisplayString
());
27802
Assert.Equal("System.Void", c4M02Remove.ReturnTypeWithAnnotations.
ToTestDisplayString
());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
SymbolUtilities.cs (1)
113
return types.Select(t => t.
ToTestDisplayString
()).ToArray();