112 references to ToStrings
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (52)
FieldKeywordTests.cs (6)
10205AssertEx.Equal(["A(2)"], actualFields[0].GetAttributes().ToStrings()); 10206AssertEx.Equal(["A(3)"], actualFields[1].GetAttributes().ToStrings()); 10207AssertEx.Equal(["A(5)", "A(6)"], actualFields[2].GetAttributes().ToStrings()); 10272AssertEx.Equal(["A(2)"], actualFields[0].GetAttributes().ToStrings()); 10273AssertEx.Equal(["A(3)"], actualFields[1].GetAttributes().ToStrings()); 10274AssertEx.Equal(["A(5)", "A(6)"], actualFields[2].GetAttributes().ToStrings());
PartialEventsAndConstructorsTests.cs (29)
3458AssertEx.Equal(string.Join(", ", expected), actual.ToStrings().Join(", ")); 3563AssertEx.Equal(["A(1)", "A(41)", "A(2)", "A(42)"], e.GetAttributes().ToStrings()); 3564AssertEx.Equal(["A(3)", "A(13)"], e.AddMethod!.GetAttributes().ToStrings()); 3565AssertEx.Equal(["A(23)"], e.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3566AssertEx.Equal(["A(33)"], e.AddMethod.GetReturnTypeAttributes().ToStrings()); 3567AssertEx.Equal(["A(4)", "A(14)"], e.RemoveMethod!.GetAttributes().ToStrings()); 3568AssertEx.Equal(["A(24)"], e.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 3569AssertEx.Equal(["A(34)"], e.RemoveMethod.GetReturnTypeAttributes().ToStrings()); 3574AssertEx.Equal(["A(1)", "A(41)", "A(2)", "A(42)"], eImpl.GetAttributes().ToStrings()); 3575AssertEx.Equal(["A(3)", "A(13)"], eImpl.AddMethod!.GetAttributes().ToStrings()); 3576AssertEx.Equal(["A(23)"], eImpl.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3577AssertEx.Equal(["A(33)"], eImpl.AddMethod.GetReturnTypeAttributes().ToStrings()); 3578AssertEx.Equal(["A(4)", "A(14)"], eImpl.RemoveMethod!.GetAttributes().ToStrings()); 3579AssertEx.Equal(["A(24)"], eImpl.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 3580AssertEx.Equal(["A(34)"], eImpl.RemoveMethod.GetReturnTypeAttributes().ToStrings()); 3584AssertEx.Equal(["A(1)", "A(41)", "A(2)", "A(42)"], f.GetAttributes().ToStrings()); 3585AssertEx.Equal([.. compiledGeneratedAttr, "A(11)", "A(12)"], f.AddMethod!.GetAttributes().ToStrings()); 3586AssertEx.Equal(["A(22)", "A(21)"], f.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3587AssertEx.Equal([], f.AddMethod.GetReturnTypeAttributes().ToStrings()); 3588AssertEx.Equal([.. compiledGeneratedAttr, "A(11)", "A(12)"], f.RemoveMethod!.GetAttributes().ToStrings()); 3589AssertEx.Equal(["A(22)", "A(21)"], f.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 3590AssertEx.Equal([], f.RemoveMethod.GetReturnTypeAttributes().ToStrings()); 3595AssertEx.Equal(["A(1)", "A(41)", "A(2)", "A(42)"], fImpl.GetAttributes().ToStrings()); 3596AssertEx.Equal([.. compiledGeneratedAttr, "A(11)", "A(12)"], fImpl.AddMethod!.GetAttributes().ToStrings()); 3597AssertEx.Equal(["A(22)", "A(21)"], fImpl.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3598AssertEx.Equal([], fImpl.AddMethod.GetReturnTypeAttributes().ToStrings()); 3599AssertEx.Equal([.. compiledGeneratedAttr, "A(11)", "A(12)"], fImpl.RemoveMethod!.GetAttributes().ToStrings()); 3600AssertEx.Equal(["A(22)", "A(21)"], fImpl.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 3601AssertEx.Equal([], fImpl.RemoveMethod.GetReturnTypeAttributes().ToStrings());
Semantics\ExtensionTests.cs (1)
34924implementation.GetAttributes().ToStrings());
Semantics\ExtensionTests2.cs (16)
1005m.GlobalNamespace.GetMember<MethodSymbol>("E.M").Parameters[1].GetAttributes().ToStrings()); 1032m.GlobalNamespace.GetMember<MethodSymbol>("E.M").Parameters[0].GetAttributes().ToStrings()); 1035m.GlobalNamespace.GetMember<MethodSymbol>("E.get_Property").Parameters[0].GetAttributes().ToStrings()); 1169m.GlobalNamespace.GetMember<MethodSymbol>("E.get_P").GetReturnTypeAttributes().ToStrings()); 1795m.GlobalNamespace.GetMember<MethodSymbol>("E.get_P").GetReturnTypeAttributes().ToStrings()); 1862m.GlobalNamespace.GetMember<MethodSymbol>("E.get_P").GetReturnTypeAttributes().ToStrings()); 1911m.GlobalNamespace.GetMember<MethodSymbol>("E.set_P").Parameters[0].GetAttributes().ToStrings()); 1974m.GlobalNamespace.GetMember<MethodSymbol>("E.set_P").Parameters[0].GetAttributes().ToStrings()); 3228m.GlobalNamespace.GetTypeMember("E").GetAttributes().ToStrings()); 3279m.GlobalNamespace.GetTypeMember("E").GetAttributes().ToStrings()); 3326], e.GetAttributes().ToStrings()); 3329AssertEx.Equal(["System.Runtime.CompilerServices.NullableContextAttribute(2)"], extensionMethod.GetAttributes().ToStrings()); 3331AssertEx.Equal(["System.Runtime.CompilerServices.NullableContextAttribute(2)"], implementationMethod.GetAttributes().ToStrings()); 3531], e.GetAttributes().ToStrings()); 3534AssertEx.SetEqual(["System.Runtime.CompilerServices.NullableContextAttribute(1)"], extensionMethod.GetAttributes().ToStrings()); 3536AssertEx.SetEqual(["System.Runtime.CompilerServices.NullableContextAttribute(1)"], implementationMethod.GetAttributes().ToStrings());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (60)
Symbols\PartialPropertiesTests.cs (38)
3697AssertEx.Equal([declAttribute, implAttribute], property.GetAttributes().ToStrings()); 3698AssertEx.Equal([declAttribute, implAttribute], property.PartialImplementationPart!.GetAttributes().ToStrings()); 3731AssertEx.Equal([declAttribute, implAttribute], property.GetAttributes().ToStrings()); 3734AssertEx.Equal([declAttribute, implAttribute], ((SourcePropertySymbol)property).PartialImplementationPart!.GetAttributes().ToStrings()); 3767AssertEx.Equal(["A(1)", "B(1)", "A(2)", "B(2)"], property.GetAttributes().ToStrings()); 3768AssertEx.Equal(["A(1)", "B(1)", "A(2)", "B(2)"], property.PartialImplementationPart!.GetAttributes().ToStrings()); 3807AssertEx.Equal(["A(1)", "B(1)", "A(2)", "B(2)"], accessor.GetAttributes().ToStrings()); 3808AssertEx.Equal(["A(1)", "B(1)", "A(2)", "B(2)"], accessor.PartialImplementationPart!.GetAttributes().ToStrings()); 3856AssertEx.Equal(["A(1)", "B(1)", "A(2)", "B(2)"], accessor.GetAttributes().ToStrings()); 3857AssertEx.Equal(["A(1)", "B(1)", "A(2)", "B(2)"], accessor.PartialImplementationPart!.GetAttributes().ToStrings()); 3897AssertEx.Equal([], accessor.GetAttributes().ToStrings()); 3898AssertEx.Equal([], accessor.PartialImplementationPart.GetAttributes().ToStrings()); 3899AssertEx.Equal(["A(2)", "B(2)", "A(1)", "B(1)"], accessor.Parameters.Single().GetAttributes().ToStrings()); 3900AssertEx.Equal(["A(2)", "B(2)", "A(1)", "B(1)"], accessor.PartialImplementationPart!.Parameters.Single().GetAttributes().ToStrings()); 3930AssertEx.Equal(["A(1)", "B(1)", "A(2)", "B(2)"], indexer.GetAttributes().ToStrings()); 3931AssertEx.Equal(["A(1)", "B(1)", "A(2)", "B(2)"], indexer.PartialImplementationPart!.GetAttributes().ToStrings()); 3972AssertEx.Equal(["A(2)", "B(2)", "A(1)", "B(1)"], param.GetAttributes().ToStrings()); 4024AssertEx.Equal(["Attr", "Attr"], property.GetAttributes().ToStrings()); 4025AssertEx.Equal(["Attr", "Attr"], property.GetMethod!.GetAttributes().ToStrings()); 4026AssertEx.Equal(["Attr", "Attr"], property.SetMethod!.GetAttributes().ToStrings()); 4027AssertEx.Equal(["Attr", "Attr"], property.SetMethod!.Parameters.Single().GetAttributes().ToStrings()); 4086AssertEx.Equal(["Attr", "Attr"], property.GetAttributes().ToStrings()); 4087AssertEx.Equal(["Attr", "Attr"], property.GetMethod!.GetAttributes().ToStrings()); 4088AssertEx.Equal(["Attr", "Attr"], property.GetMethod!.Parameters[0].GetAttributes().ToStrings()); 4089AssertEx.Equal(["Attr", "Attr"], property.GetMethod!.Parameters[1].GetAttributes().ToStrings()); 4090AssertEx.Equal(["Attr", "Attr"], property.SetMethod!.GetAttributes().ToStrings()); 4091AssertEx.Equal(["Attr", "Attr"], property.SetMethod!.Parameters[0].GetAttributes().ToStrings()); 4092AssertEx.Equal(["Attr", "Attr"], property.SetMethod!.Parameters[1].GetAttributes().ToStrings()); 4093AssertEx.Equal(["Attr", "Attr"], property.SetMethod!.Parameters[2].GetAttributes().ToStrings()); 4126AssertEx.Equal([], property.GetAttributes().ToStrings()); 4405AssertEx.Equal(["System.Runtime.CompilerServices.CallerLineNumberAttribute"], indexer.Parameters[1].GetAttributes().ToStrings()); 4448AssertEx.Equal(["System.Runtime.CompilerServices.CallerLineNumberAttribute"], indexer.Parameters[1].GetAttributes().ToStrings()); 4484AssertEx.Equal(["System.Runtime.CompilerServices.CallerFilePathAttribute"], indexer.Parameters[1].GetAttributes().ToStrings()); 4526AssertEx.Equal(["System.Runtime.CompilerServices.CallerFilePathAttribute"], indexer.Parameters[1].GetAttributes().ToStrings()); 4562AssertEx.Equal(["System.Runtime.CompilerServices.CallerMemberNameAttribute"], indexer.Parameters[1].GetAttributes().ToStrings()); 4604AssertEx.Equal(["System.Runtime.CompilerServices.CallerMemberNameAttribute"], indexer.Parameters[1].GetAttributes().ToStrings()); 4655AssertEx.Equal(["""System.Runtime.CompilerServices.CallerArgumentExpressionAttribute("x")"""], indexer.Parameters[1].GetAttributes().ToStrings()); 4712AssertEx.Equal(["""System.Runtime.CompilerServices.CallerArgumentExpressionAttribute("x")"""], indexer.Parameters[1].GetAttributes().ToStrings());
Symbols\Source\EventTests.cs (22)
2858AssertEx.Equal(["A(1)", "A(5)"], e.GetAttributes().ToStrings()); 2859AssertEx.Equal([.. compiledGeneratedAttr, "A(2)"], e.AddMethod!.GetAttributes().ToStrings()); 2860AssertEx.Equal(["A(3)"], e.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 2861AssertEx.Equal([], e.AddMethod.GetReturnTypeAttributes().ToStrings()); 2862AssertEx.Equal([.. compiledGeneratedAttr, "A(2)"], e.RemoveMethod!.GetAttributes().ToStrings()); 2863AssertEx.Equal(["A(3)"], e.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 2864AssertEx.Equal([], e.RemoveMethod.GetReturnTypeAttributes().ToStrings()); 2865AssertEx.Equal([.. compiledGeneratedAttr, "A(6)"], e.AssociatedField.GetAttributes().ToStrings()); 2868AssertEx.Equal(["A(1)", "A(5)"], f.GetAttributes().ToStrings()); 2869AssertEx.Equal([.. compiledGeneratedAttr, "A(2)"], f.AddMethod!.GetAttributes().ToStrings()); 2870AssertEx.Equal(["A(3)"], f.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 2871AssertEx.Equal([], f.AddMethod.GetReturnTypeAttributes().ToStrings()); 2872AssertEx.Equal([.. compiledGeneratedAttr, "A(2)"], f.RemoveMethod!.GetAttributes().ToStrings()); 2873AssertEx.Equal(["A(3)"], f.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 2874AssertEx.Equal([], f.RemoveMethod.GetReturnTypeAttributes().ToStrings()); 2877AssertEx.Equal(["A(1)", "A(5)"], g.GetAttributes().ToStrings()); 2878AssertEx.Equal(["A(21)", "A(22)"], g.AddMethod!.GetAttributes().ToStrings()); 2879AssertEx.Equal(["A(23)"], g.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 2880AssertEx.Equal(["A(24)"], g.AddMethod.GetReturnTypeAttributes().ToStrings()); 2881AssertEx.Equal(["A(31)", "A(32)"], g.RemoveMethod!.GetAttributes().ToStrings()); 2882AssertEx.Equal(["A(33)"], g.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 2883AssertEx.Equal(["A(34)"], g.RemoveMethod.GetReturnTypeAttributes().ToStrings());