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)
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)
2370
Assert.Equal("System.Int32", local.IteratorElementTypeWithAnnotations.
ToTestDisplayString
());
2376
Assert.Equal("System.Int32", local.IteratorElementTypeWithAnnotations.
ToTestDisplayString
());
Semantics\NullableReferenceTypesTests.cs (103)
11199
Assert.Equal(displayName, type.
ToTestDisplayString
(true));
11302
Assert.Equal(displayName, type.
ToTestDisplayString
(true));
13851
Assert.Equal("C<System.String? modopt(System.Runtime.CompilerServices.IsConst), System.String>", m1.OverriddenMethod.ReturnTypeWithAnnotations.
ToTestDisplayString
());
13852
Assert.Equal("C<System.String modopt(System.Runtime.CompilerServices.IsConst), System.String?>", m1.ReturnTypeWithAnnotations.
ToTestDisplayString
());
59062
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59096
Assert.Equal("System.String", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59124
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59156
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59185
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59218
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59250
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59283
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59317
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59344
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59374
Assert.Equal("var?", type.
ToTestDisplayString
());
59402
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59406
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
59410
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
());
71320
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71323
Assert.Equal("System.Int32", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71356
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71359
Assert.Equal("System.Int32?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71397
Assert.Equal("T?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71400
Assert.Equal("T?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71434
Assert.Equal("T?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71437
Assert.Equal("T?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71471
Assert.Equal("System.String!", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71474
Assert.Equal("System.Int32", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71506
Assert.Equal("System.String?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71509
Assert.Equal("System.Int32?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71539
Assert.Equal("T", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71576
Assert.Equal("T!", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
71579
Assert.Equal("T?", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
81325
Assert.Equal("System.String!", symbol.TypeWithAnnotations.
ToTestDisplayString
(true));
111590
Assert.Equal("A1", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111592
Assert.Equal("A2<System.Object>", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111634
Assert.Equal("A1", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111635
Assert.Equal("A1?", typeParameters[1].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111637
Assert.Equal("A2<System.Object>", typeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111638
Assert.Equal("A2<System.Object?>", typeParameters[1].ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
111778
AssertEx.Equal(expectedTypes, constraintTypes.SelectAsArray(t => t.
ToTestDisplayString
(true)));
111843
AssertEx.Equal(expectedConstraintTypes, constraintTypes.SelectAsArray(t => t.
ToTestDisplayString
(true)));
111896
AssertEx.Equal(expectedConstraintTypes, constraintTypes.SelectAsArray(t => t.
ToTestDisplayString
(true)));
111939
Assert.Equal("I<T>", constraintTypes[0].
ToTestDisplayString
(true));
112670
Assert.Equal(expected, constraintType.
ToTestDisplayString
());
112759
Assert.Equal(expected, constraintType.
ToTestDisplayString
());
113249
Assert.Equal("B[]", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113252
Assert.Equal("C![]!", f2.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113298
Assert.Equal("B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113327
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113364
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113395
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113436
Assert.Equal("System.String!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113458
Assert.Equal("System.String", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113488
Assert.Equal("B[]!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113513
Assert.Equal("B![]", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113598
Assert.Equal("B<A>!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113623
Assert.Equal("B<A!>", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113659
Assert.Equal("var!", model.GetDeclaredSymbol(decl.Designation).GetSymbol<LocalSymbol>().TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
113690
Assert.Equal("var", model.GetDeclaredSymbol(decl.Designation).GetSymbol<LocalSymbol>().TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114314
Assert.Equal("C!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114339
Assert.Equal("C", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114372
Assert.Equal("C.B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114400
Assert.Equal("C.B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114433
Assert.Equal("C.B<A>!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114461
Assert.Equal("C.B<A!>", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114491
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114527
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114564
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114600
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114630
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114662
Assert.Equal("B", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114693
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114724
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114754
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114785
Assert.Equal("B?", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114815
Assert.Equal("B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
114844
Assert.Equal("B!", f1.TypeWithAnnotations.
ToTestDisplayString
(includeNonNullable: true));
123979
Assert.Equal(baseline[i].type, f.TypeWithAnnotations.
ToTestDisplayString
(true));
137050
Assert.Equal("System.IEquatable<T>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137084
Assert.Equal("System.IEquatable<T?>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137112
Assert.Equal("System.IEquatable<T>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137148
Assert.Equal("System.IEquatable<System.String?>?", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137323
Assert.Equal("System.IEquatable<T>?", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137348
Assert.Equal("System.IEquatable<T>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
137378
Assert.Equal("System.IEquatable<T!>?", t.ConstraintTypesNoUseSiteDiagnostics[i].
ToTestDisplayString
(true));
137379
Assert.Equal("System.IEquatable<System.String?>!", t.ConstraintTypesNoUseSiteDiagnostics[j].
ToTestDisplayString
(true));
137427
Assert.Equal("I1<System.String?, System.String>", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137433
Assert.Equal("I1<System.String, System.String?>", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137439
Assert.Equal("I1<System.String, System.String>?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137469
Assert.Equal("I1<System.String?, System.String?>?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137510
Assert.Equal("I1?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137511
Assert.Equal("I2?", t.ConstraintTypesNoUseSiteDiagnostics[1].
ToTestDisplayString
(true));
137551
Assert.Equal("I1!", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137552
Assert.Equal("I2!", t.ConstraintTypesNoUseSiteDiagnostics[1].
ToTestDisplayString
(true));
137590
Assert.Equal("I1?", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137591
Assert.Equal("I2?", t.ConstraintTypesNoUseSiteDiagnostics[1].
ToTestDisplayString
(true));
137629
Assert.Equal("I1!", t.ConstraintTypesNoUseSiteDiagnostics[0].
ToTestDisplayString
(true));
137630
Assert.Equal("I2!", t.ConstraintTypesNoUseSiteDiagnostics[1].
ToTestDisplayString
(true));
138828
Assert.Equal("System.IEquatable<T>!", f.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
138829
Assert.Equal("System.IEquatable<T>", f.PartialImplementationPart.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
138853
Assert.Equal("System.IEquatable<T?>!", f.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().
ToTestDisplayString
(true));
138855
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();