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));
81365
Assert.Equal("System.String!", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
111652
Assert.Equal("A1", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111654
Assert.Equal("A2<System.Object>", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111696
Assert.Equal("A1", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111697
Assert.Equal("A1?", typeParameters[1].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111699
Assert.Equal("A2<System.Object>", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111700
Assert.Equal("A2<System.Object?>", typeParameters[1].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111840
AssertEx.Equal(expectedTypes, constraintTypes.SelectAsArray(t => t.
ToTestDisplayString
(true)));
111905
AssertEx.Equal(expectedConstraintTypes, constraintTypes.SelectAsArray(t => t.
ToTestDisplayString
(true)));
111958
AssertEx.Equal(expectedConstraintTypes, constraintTypes.SelectAsArray(t => t.
ToTestDisplayString
(true)));
112001
Assert.Equal("I<T>", constraintTypes[0].
ToTestDisplayString
(true));
112732
Assert.Equal(expected, constraintType.
ToTestDisplayString
());
112821
Assert.Equal(expected, constraintType.
ToTestDisplayString
());
113311
Assert.Equal("B[]", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113314
Assert.Equal("C![]!", f2.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113360
Assert.Equal("B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113389
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113426
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113457
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113498
Assert.Equal("System.String!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113520
Assert.Equal("System.String", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113550
Assert.Equal("B[]!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113575
Assert.Equal("B![]", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113660
Assert.Equal("B<A>!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113685
Assert.Equal("B<A!>", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113721
Assert.Equal("var!", model.GetDeclaredSymbol(decl.Designation).GetSymbol<LocalSymbol>().TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113752
Assert.Equal("var", model.GetDeclaredSymbol(decl.Designation).GetSymbol<LocalSymbol>().TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114376
Assert.Equal("C!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114401
Assert.Equal("C", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114434
Assert.Equal("C.B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114462
Assert.Equal("C.B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114495
Assert.Equal("C.B<A>!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114523
Assert.Equal("C.B<A!>", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114553
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114589
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114626
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114662
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114692
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114724
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114755
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114786
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114816
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114847
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114877
Assert.Equal("B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114906
Assert.Equal("B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
124041
Assert.Equal(baseline[i].type, f.TypeWithAnnotations.
ToTestDisplayString
(true));
137112
Assert.Equal("System.IEquatable<T>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137146
Assert.Equal("System.IEquatable<T?>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137174
Assert.Equal("System.IEquatable<T>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137210
Assert.Equal("System.IEquatable<System.String?>?", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137385
Assert.Equal("System.IEquatable<T>?", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137410
Assert.Equal("System.IEquatable<T>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137440
Assert.Equal("System.IEquatable<T!>?", t.ConstraintTypesNoUseSiteDiagnostics[i].
ToTestDisplayString
(true));
137441
Assert.Equal("System.IEquatable<System.String?>!", t.ConstraintTypesNoUseSiteDiagnostics[j].
ToTestDisplayString
(true));
137489
Assert.Equal("I1<System.String?, System.String>", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137495
Assert.Equal("I1<System.String, System.String?>", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137501
Assert.Equal("I1<System.String, System.String>?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137531
Assert.Equal("I1<System.String?, System.String?>?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137572
Assert.Equal("I1?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137573
Assert.Equal("I2?", t.ConstraintTypesNoUseSiteDiagnostics[1].
ToTestDisplayString
(true));
137613
Assert.Equal("I1!", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137614
Assert.Equal("I2!", t.ConstraintTypesNoUseSiteDiagnostics[1].
ToTestDisplayString
(true));
137652
Assert.Equal("I1?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137653
Assert.Equal("I2?", t.ConstraintTypesNoUseSiteDiagnostics[1].
ToTestDisplayString
(true));
137691
Assert.Equal("I1!", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137692
Assert.Equal("I2!", t.ConstraintTypesNoUseSiteDiagnostics[1].
ToTestDisplayString
(true));
138890
Assert.Equal("System.IEquatable<T>!", f.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
138891
Assert.Equal("System.IEquatable<T>", f.PartialImplementationPart.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
138915
Assert.Equal("System.IEquatable<T?>!", f.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
138917
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)
27798
Assert.Equal("System.Void", c3M02Remove.ReturnTypeWithAnnotations.
ToTestDisplayString
());
27867
Assert.Equal("System.Void", c4M02Add.ReturnTypeWithAnnotations.
ToTestDisplayString
());
27880
Assert.Equal("System.Void", c4M02Remove.ReturnTypeWithAnnotations.
ToTestDisplayString
());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
SymbolUtilities.cs (1)
113
return types.Select(t => t.
ToTestDisplayString
()).ToArray();