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)
11577
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)
4180
AssertEx.Equal("System.String?", m.GlobalNamespace.GetMember<MethodSymbol>("Extensions.<>E__0.<Extension>$").Parameters[0].TypeWithAnnotations.
ToTestDisplayString
());
4181
AssertEx.Equal("System.String?", m.GlobalNamespace.GetMember<MethodSymbol>("Extensions.<>E__1.<Extension>$").Parameters[0].TypeWithAnnotations.
ToTestDisplayString
());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (110)
Semantics\ForEachTests.cs (2)
1638
Assert.Equal("C.var", info.ElementTypeWithAnnotations.
ToTestDisplayString
());
1649
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)
2378
Assert.Equal("System.Int32", local.IteratorElementTypeWithAnnotations.
ToTestDisplayString
());
2384
Assert.Equal("System.Int32", local.IteratorElementTypeWithAnnotations.
ToTestDisplayString
());
Semantics\NullableReferenceTypesTests.cs (103)
11202
Assert.Equal(displayName, type.
ToTestDisplayString
(true));
11305
Assert.Equal(displayName, type.
ToTestDisplayString
(true));
13854
Assert.Equal("C<System.String? modopt(System.Runtime.CompilerServices.IsConst), System.String>", m1.OverriddenMethod.ReturnTypeWithAnnotations.
ToTestDisplayString
());
13855
Assert.Equal("C<System.String modopt(System.Runtime.CompilerServices.IsConst), System.String?>", m1.ReturnTypeWithAnnotations.
ToTestDisplayString
());
59061
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59095
Assert.Equal("System.String", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59123
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59155
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59184
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59217
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59249
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59282
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59316
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59343
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59373
Assert.Equal("var?", type.
ToTestDisplayString
());
59401
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59405
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59409
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
71296
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71299
Assert.Equal("System.Int32", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71332
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71335
Assert.Equal("System.Int32?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71373
Assert.Equal("T?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71376
Assert.Equal("T?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71410
Assert.Equal("T?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71413
Assert.Equal("T?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71447
Assert.Equal("System.String!", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71450
Assert.Equal("System.Int32", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71482
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71485
Assert.Equal("System.Int32?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71515
Assert.Equal("T", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71552
Assert.Equal("T!", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71555
Assert.Equal("T?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
81303
Assert.Equal("System.String!", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
111568
Assert.Equal("A1", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111570
Assert.Equal("A2<System.Object>", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111612
Assert.Equal("A1", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111613
Assert.Equal("A1?", typeParameters[1].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111615
Assert.Equal("A2<System.Object>", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111616
Assert.Equal("A2<System.Object?>", typeParameters[1].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111756
AssertEx.Equal(expectedTypes, constraintTypes.SelectAsArray(t => t.
ToTestDisplayString
(true)));
111821
AssertEx.Equal(expectedConstraintTypes, constraintTypes.SelectAsArray(t => t.
ToTestDisplayString
(true)));
111874
AssertEx.Equal(expectedConstraintTypes, constraintTypes.SelectAsArray(t => t.
ToTestDisplayString
(true)));
111917
Assert.Equal("I<T>", constraintTypes[0].
ToTestDisplayString
(true));
112648
Assert.Equal(expected, constraintType.
ToTestDisplayString
());
112737
Assert.Equal(expected, constraintType.
ToTestDisplayString
());
113227
Assert.Equal("B[]", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113230
Assert.Equal("C![]!", f2.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113276
Assert.Equal("B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113305
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113342
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113373
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113414
Assert.Equal("System.String!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113436
Assert.Equal("System.String", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113466
Assert.Equal("B[]!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113491
Assert.Equal("B![]", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113576
Assert.Equal("B<A>!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113601
Assert.Equal("B<A!>", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113637
Assert.Equal("var!", model.GetDeclaredSymbol(decl.Designation).GetSymbol<LocalSymbol>().TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113668
Assert.Equal("var", model.GetDeclaredSymbol(decl.Designation).GetSymbol<LocalSymbol>().TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114292
Assert.Equal("C!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114317
Assert.Equal("C", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114350
Assert.Equal("C.B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114378
Assert.Equal("C.B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114411
Assert.Equal("C.B<A>!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114439
Assert.Equal("C.B<A!>", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114469
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114505
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114542
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114578
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114608
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114640
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114671
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114702
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114732
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114763
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114793
Assert.Equal("B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114822
Assert.Equal("B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
123957
Assert.Equal(baseline[i].type, f.TypeWithAnnotations.
ToTestDisplayString
(true));
137031
Assert.Equal("System.IEquatable<T>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137065
Assert.Equal("System.IEquatable<T?>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137093
Assert.Equal("System.IEquatable<T>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137129
Assert.Equal("System.IEquatable<System.String?>?", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137304
Assert.Equal("System.IEquatable<T>?", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137329
Assert.Equal("System.IEquatable<T>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137359
Assert.Equal("System.IEquatable<T!>?", t.ConstraintTypesNoUseSiteDiagnostics[i].
ToTestDisplayString
(true));
137360
Assert.Equal("System.IEquatable<System.String?>!", t.ConstraintTypesNoUseSiteDiagnostics[j].
ToTestDisplayString
(true));
137408
Assert.Equal("I1<System.String?, System.String>", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137414
Assert.Equal("I1<System.String, System.String?>", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137420
Assert.Equal("I1<System.String, System.String>?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137450
Assert.Equal("I1<System.String?, System.String?>?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137491
Assert.Equal("I1?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137492
Assert.Equal("I2?", t.ConstraintTypesNoUseSiteDiagnostics[1].
ToTestDisplayString
(true));
137532
Assert.Equal("I1!", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137533
Assert.Equal("I2!", t.ConstraintTypesNoUseSiteDiagnostics[1].
ToTestDisplayString
(true));
137571
Assert.Equal("I1?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137572
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));
138809
Assert.Equal("System.IEquatable<T>!", f.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
138810
Assert.Equal("System.IEquatable<T>", f.PartialImplementationPart.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
138834
Assert.Equal("System.IEquatable<T?>!", f.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
138836
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();