39 overrides of GetAttributes
Microsoft.CodeAnalysis.CSharp (39)
Lowering\StateMachineRewriter\StateMachineTypeSymbol.cs (1)
53public sealed override ImmutableArray<CSharpAttributeData> GetAttributes()
Lowering\StateMachineRewriter\SynthesizedStateMachineMethod.cs (1)
70public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Metadata\PE\PEAssemblySymbol.cs (1)
132public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Metadata\PE\PEEventSymbol.cs (1)
360public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
578public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
948public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Metadata\PE\PEModuleSymbol.cs (1)
240public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
682public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
1012public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Metadata\PE\PEPropertySymbol.cs (1)
636public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Metadata\PE\PETypeParameterSymbol.cs (1)
631public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\ReducedExtensionMethodSymbol.cs (1)
449public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Retargeting\RetargetingAssemblySymbol.cs (1)
201public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Retargeting\RetargetingEventSymbol.cs (1)
156public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Retargeting\RetargetingFieldSymbol.cs (1)
78public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Retargeting\RetargetingMethodSymbol.cs (1)
211public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Retargeting\RetargetingModuleSymbol.cs (1)
276public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (1)
227public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Retargeting\RetargetingPropertySymbol.cs (1)
216public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
71public sealed override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\ImplicitNamedTypeSymbol.cs (1)
34public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\SourceAssemblySymbol.cs (1)
1586public sealed override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\SourceClonedParameterSymbol.cs (1)
108public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\SourceEventSymbol.cs (1)
205public sealed override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
308public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\SourceModuleSymbol.cs (1)
483public sealed override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\SourceNamedTypeSymbol.cs (1)
860public sealed override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\SourceParameterSymbol.cs (1)
199public sealed override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\SourcePropertySymbolBase.cs (1)
1078public sealed override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\SourceTypeParameterSymbol.cs (1)
165public sealed override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\SubstitutedEventSymbol.cs (1)
54public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\SubstitutedFieldSymbol.cs (1)
77public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\SubstitutedMethodSymbol.cs (1)
205public sealed override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\SubstitutedNamedTypeSymbol.cs (1)
183public sealed override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\SubstitutedPropertySymbol.cs (1)
63public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Synthesized\SynthesizedParameterSymbol.cs (1)
354public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Tuples\TupleFieldSymbol.cs (1)
133public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Wrapped\WrappedParameterSymbol.cs (1)
69public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Wrapped\WrappedTypeParameterSymbol.cs (1)
170public override ImmutableArray<CSharpAttributeData> GetAttributes()
1216 references to GetAttributes
Microsoft.CodeAnalysis.CSharp (43)
Binder\Binder.cs (1)
667leastOverriddenSymbol.GetAttributes();
Compiler\ClsComplianceChecker.cs (4)
335foreach (CSharpAttributeData attribute in symbol.GetAttributes()) 581CheckForAttributeWithArrayArgumentInternal(symbol.GetAttributes()); 688if (TryGetClsComplianceAttributeLocation(parameters[i].GetAttributes(), parameters[i], out attributeLocation)) 1180foreach (CSharpAttributeData data in symbol.GetAttributes())
Emitter\Model\SymbolAdapter.cs (1)
99userDefined = this.GetAttributes();
Emitter\NoPia\EmbeddedEvent.cs (1)
78foreach (var attrData in underlyingContainingType.GetAttributes())
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
541if (!reportedAttributes && !p.GetAttributes().IsEmpty)
Lowering\LocalRewriter\LocalRewriter_Event.cs (1)
28foreach (var attrData in @interface.GetAttributes())
Lowering\StateMachineRewriter\StateMachineTypeSymbol.cs (2)
57Debug.Assert(base.GetAttributes().Length == 0); 63foreach (var attribute in kickoffType.GetAttributes())
Lowering\StateMachineRewriter\SynthesizedStateMachineMethod.cs (2)
74Debug.Assert(base.GetAttributes().Length == 0); 80foreach (var attribute in kickoffMethod.GetAttributes())
Lowering\SynthesizedMethodBaseSymbol.cs (1)
165? BaseMethod.GetAttributes()
Symbols\EventSymbol.cs (1)
119this.AssociatedField.GetAttributes();
Symbols\PublicModel\Symbol.cs (1)
122return StaticCast<AttributeData>.From(UnderlyingSymbol.GetAttributes());
Symbols\ReducedExtensionMethodSymbol.cs (1)
451return _reducedFrom.GetAttributes();
Symbols\Retargeting\RetargetingEventSymbol.cs (1)
158return _underlyingEvent.GetAttributes();
Symbols\Retargeting\RetargetingFieldSymbol.cs (1)
80return this.RetargetingTranslator.GetRetargetedAttributes(_underlyingField.GetAttributes(), ref _lazyCustomAttributes);
Symbols\Retargeting\RetargetingMethodSymbol.cs (1)
213return this.RetargetingTranslator.GetRetargetedAttributes(_underlyingMethod.GetAttributes(), ref _lazyCustomAttributes);
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (1)
229return this.RetargetingTranslator.GetRetargetedAttributes(_underlyingType.GetAttributes(), ref _lazyCustomAttributes);
Symbols\Retargeting\RetargetingParameterSymbol.cs (1)
63return this.RetargetingModule.RetargetingTranslator.GetRetargetedAttributes(_underlyingParameter.GetAttributes(), ref _lazyCustomAttributes);
Symbols\Retargeting\RetargetingPropertySymbol.cs (1)
218return this.RetargetingTranslator.GetRetargetedAttributes(_underlyingProperty.GetAttributes(), ref _lazyCustomAttributes);
Symbols\Retargeting\RetargetingSymbolTranslator.cs (1)
344foreach (var attrData in type.GetAttributes())
Symbols\Retargeting\RetargetingTypeParameterSymbol.cs (1)
65return this.RetargetingTranslator.GetRetargetedAttributes(_underlyingTypeParameter.GetAttributes(), ref _lazyCustomAttributes);
Symbols\Source\SourceMemberContainerSymbol.cs (1)
533GetAttributes();
Symbols\Source\SourceMemberMethodSymbol.cs (1)
771field.GetAttributes();
Symbols\Source\SourceModuleSymbol.cs (1)
309foreach (var attrData in a.GetAttributes())
Symbols\SubstitutedEventSymbol.cs (1)
56return OriginalDefinition.GetAttributes();
Symbols\SubstitutedFieldSymbol.cs (1)
79return OriginalDefinition.GetAttributes();
Symbols\SubstitutedMethodSymbol.cs (1)
207return this.OriginalDefinition.GetAttributes();
Symbols\SubstitutedNamedTypeSymbol.cs (1)
185return OriginalDefinition.GetAttributes();
Symbols\SubstitutedPropertySymbol.cs (1)
65return OriginalDefinition.GetAttributes();
Symbols\Symbol.cs (1)
1302foreach (var attrData in this.GetAttributes())
Symbols\Symbol_Attributes.cs (1)
931this.GetAttributes();
Symbols\SymbolCompletionState.cs (2)
43/// of <see cref="Symbol.GetAttributes"/> will set the part <see cref="CompletionPart.Attributes"/> on 53_ = symbol.GetAttributes();
Symbols\SymbolExtensions.cs (1)
828foreach (var attr in symbol.GetAttributes())
Symbols\Synthesized\SynthesizedSubstitutedTypeParameterSymbol.cs (1)
49return _underlyingTypeParameter.GetAttributes();
Symbols\Tuples\TupleFieldSymbol.cs (2)
135return _underlyingField.GetAttributes(); 326return _underlyingField.GetAttributes();
Symbols\Wrapped\WrappedParameterSymbol.cs (1)
71return _underlyingParameter.GetAttributes();
Symbols\Wrapped\WrappedTypeParameterSymbol.cs (1)
172return _underlyingTypeParameter.GetAttributes();
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (87)
CodeGen\CodeGenAsyncIteratorTests.cs (3)
855GetAttributeNames(method.GetAttributes())); 857var attribute = method.GetAttributes().Single(); 882Assert.Empty(GetAttributeNames(method.GetAttributes()));
CodeGen\CodeGenDynamicTests.cs (6)
595AssertEx.SetEqual(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(container.GetAttributes())); 608Assert.Equal(0, field.GetAttributes().Length); 653var attributes = d.GetAttributes(); 686Assert.Equal(0, member.GetAttributes().Length); 804Assert.Equal(0, container.GetMembers().Single().GetAttributes().Length); 832AssertEx.SetEqual(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(d.GetAttributes()));
CodeGen\CodeGenFunctionPointersTests.cs (15)
5406string getAttribute(string fieldName) => c.GetField(fieldName).GetAttributes().Single().ToString()!; 5462Assert.Empty(field.GetAttributes()); 5466Assert.Equal(expectedAttribute, field.GetAttributes().Single().ToString()); 5548Assert.Empty(f.GetAttributes()); 5552Assert.Equal(expectedAttribute, f.GetAttributes().Single().ToString()); 5601Assert.Equal("System.Runtime.CompilerServices.DynamicAttribute({false, false, false, false, false, true, false, true})", param.GetAttributes().Single().ToString()); 11618var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 11646var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 11699var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 11756var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 11788var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 12015var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 12148var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 12176var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 12206var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A");
CodeGen\CodeGenLocalFunctionTests.cs (20)
5236var attrs1 = localFn1.GetAttributes(); 5246var attrs3 = localFn3.GetParameters().Single().GetAttributes(); 5250var attrs4 = localFn4.TypeParameters.Single().GetAttributes(); 5285var attrs = localFn1.GetAttributes(); 5326var attrs1 = localFn1.GetAttributes(); 5359var attrs1 = localFn1.GetAttributes(); 5366Assert.Empty(param.GetAttributes()); 5393var attrs1 = localFn1.GetAttributes(); 5399Assert.Equal("DynamicAttribute", param.GetAttributes().Single().AttributeClass.Name); 5426var attrs1 = localFn1.GetAttributes(); 5432Assert.Empty(param.GetAttributes()); 5539var attrs1 = localFn1.GetAttributes(); 5635var attrs1 = localFn1.GetAttributes(); 5638Assert.Equal(new[] { "Attr" }, GetAttributeNames(localFn1.TypeParameters.Single().GetAttributes())); 5639Assert.Equal(new[] { "Attr" }, GetAttributeNames(localFn1.Parameters.Single().GetAttributes())); 5646var attrs1 = localFn1.GetAttributes(); 5649Assert.Empty(localFn1.TypeParameters.Single().GetAttributes()); 5650Assert.Empty(localFn1.Parameters.Single().GetAttributes()); 5760var attrs1 = localFn1.GetAttributes().As<CSharpAttributeData>(); 5834var attrs1 = localFn1.GetAttributes().As<CSharpAttributeData>();
CodeGen\CodeGenReadonlyStructTests.cs (1)
912Assert.Empty(s1.GetAttributes());
CodeGen\CodeGenTupleTest.cs (35)
3365Assert.True(mFirst.GetAttributes().IsEmpty); 3383Assert.True(mItem1.GetAttributes().IsEmpty); 4602Assert.True(mItem1.GetAttributes().IsEmpty); 11217Assert.True(m1Tuple.GetAttributes().IsEmpty); 11259Assert.True(m1Item1.GetAttributes().IsEmpty); 11280Assert.True(m2Item1.GetAttributes().IsEmpty); 11301Assert.True(m2a2.GetAttributes().IsEmpty); 11507Assert.True(m1Tuple.GetAttributes().IsEmpty); 11554Assert.True(m1Item9.GetAttributes().IsEmpty); 11569Assert.True(m2Item9.GetAttributes().IsEmpty); 11586Assert.True(m2i2.GetAttributes().IsEmpty); 11788Assert.True(m3Item8.GetAttributes().IsEmpty); 11981Assert.True(m4Item8.GetAttributes().IsEmpty); 12000Assert.True(m4h4.GetAttributes().IsEmpty); 12229Assert.True(m5Item8.GetAttributes().IsEmpty); 12597Assert.True(m8Item8.GetAttributes().IsEmpty); 12617Assert.True(m8Item1.GetAttributes().IsEmpty); 12764Assert.True(m1Tuple.GetAttributes().IsEmpty); 12810Assert.True(m1Item1.GetAttributes().IsEmpty); 12829Assert.True(m2Item1.GetAttributes().IsEmpty); 12848Assert.True(m2a2.GetAttributes().IsEmpty); 12868Assert.True(m1ToString.GetAttributes().IsEmpty); 13209Assert.Equal("System.ObsoleteAttribute", m10Tuple.GetAttributes().Single().ToString()); 13223Assert.Equal("System.ObsoleteAttribute", m10Item1.GetAttributes().Single().ToString()); 13224Assert.Equal("System.ObsoleteAttribute", m102Item20.GetAttributes().Single().ToString()); 13225Assert.Equal("System.ObsoleteAttribute", m102a.GetAttributes().Single().ToString()); 13262Assert.Equal("System.ObsoleteAttribute", m10M2.GetAttributes().Single().ToString()); 13274Assert.Equal("System.ObsoleteAttribute", m10P2.GetAttributes().Single().ToString()); 13286Assert.Equal("System.ObsoleteAttribute", m10E2.GetAttributes().Single().ToString()); 15833Assert.True(m1P1.GetAttributes().IsEmpty); 15863Assert.True(m1this.GetAttributes().IsEmpty); 16063Assert.True(m1E1.GetAttributes().IsEmpty); 16094Assert.True(m1E2.GetAttributes().IsEmpty); 29009Assert.Empty(field.GetAttributes()); 29013Assert.Equal(expectedAttribute, field.GetAttributes().Single().ToString());
Emit\CompilationEmitTests.cs (4)
2153compWithReal.SourceModule.GetReferencedAssemblySymbols().Last().GetAttributes().Select(a => a.AttributeClass.ToTestDisplayString())); 2184compWithReal2.SourceModule.GetReferencedAssemblySymbols().Last().GetAttributes().Select(a => a.AttributeClass.ToTestDisplayString())); 2211compWithMetadata.SourceModule.GetReferencedAssemblySymbols().Last().GetAttributes().Select(a => a.AttributeClass.ToTestDisplayString())); 2239compWithRef.SourceModule.GetReferencedAssemblySymbols().Last().GetAttributes().Select(a => a.AttributeClass.ToTestDisplayString()));
Emit\EmitMetadataTests.cs (1)
1303var attribute = backingField.GetAttributes().Single();
Emit\NoPiaEmbedTypes.cs (1)
3109Assert.Equal(0, m1.Parameters[0].GetAttributes().Length);
Emit\OptionalArgumentsTests.cs (1)
218var attributes = parameter.GetAttributes();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (565)
Attributes\AttributeTests.cs (181)
489var attrs = assembly.GetAttributes(); 588var attributeData = (SourceAttributeData)program.GetAttributes()[0]; 620var attributeData = (SourceAttributeData)program.GetAttributes()[0]; 651var attributeData = (SourceAttributeData)program.GetAttributes()[0]; 683var attrs = m0.GetAttributes(); 1023var attrs = program.GetAttributes(); 1066var attrs = program.GetAttributes(); 1103var attributeData = (SourceAttributeData)program.GetAttributes()[0]; 1144var attributeData = (SourceAttributeData)program.GetAttributes()[0]; 1184var attributeData = (SourceAttributeData)program.GetAttributes()[0]; 1224var attributeData = (SourceAttributeData)program.GetAttributes()[0]; 1263var attributeData = (SourceAttributeData)program.GetAttributes()[0]; 1304var attributeData = (SourceAttributeData)program.GetAttributes()[0]; 1389var attrs = compilation.Assembly.GetAttributes(); 1456var attrs = compilation.SourceModule.GlobalNamespace.GetMember("A").GetAttributes(); 1480var attrs = compilation.SourceModule.GlobalNamespace.GetMember("Goo").GetAttributes(); 1566var attrs = prop.GetAttributes(); 1670var attrs = type.GetAttributes(); 1676attrs = prop.GetMethod.GetAttributes(); 1681attrs = prop.GetAttributes(); 1684attrs = prop.SetMethod.GetAttributes(); 1766Assert.Empty(prop1.GetAttributes()); 1767AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop1.GetMethod.GetAttributes())); 1768AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop1.SetMethod.GetAttributes())); 1771AssertEx.SetEqual(fieldAttributesExpected.Concat(new[] { "A(1)" }), GetAttributeStrings(field1.GetAttributes())); 1774Assert.Empty(prop2.GetAttributes()); 1775AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop2.GetMethod.GetAttributes())); 1779AssertEx.SetEqual(fieldAttributesExpected.Concat(new[] { "A(2)" }), GetAttributeStrings(field2.GetAttributes())); 1782Assert.Equal("B(3)", prop3.GetAttributes().Single().ToString()); 1783AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop3.GetMethod.GetAttributes())); 1787AssertEx.SetEqual(fieldAttributesExpected.Concat(new[] { "A(33)" }), GetAttributeStrings(field3.GetAttributes())); 1790Assert.Equal("B(4)", prop4.GetAttributes().Single().ToString()); 1791AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop3.GetMethod.GetAttributes())); 1795AssertEx.SetEqual(fieldAttributesExpected.Concat(new[] { "A(44)", "A(444)" }), GetAttributeStrings(field4.GetAttributes())); 1820Assert.Empty(field1.GetAttributes()); 1828AssertEx.SetEqual(s_backingFieldAttributes.Concat(dynamicAndTupleNames), GetAttributeStrings(field1.GetAttributes())); 1860Assert.Empty(prop1.GetAttributes()); 1863var attributes1 = field1.GetAttributes(); 1875Assert.Empty(prop2.GetAttributes()); 1878AssertEx.SetEqual(fieldAttributesExpected, GetAttributeStrings(field2.GetAttributes())); 1882var attributes3 = field3.GetAttributes(); 1922Assert.Empty(prop1.GetAttributes()); 1925var attributes1 = field1.GetAttributes(); 1937Assert.Empty(prop2.GetAttributes()); 1940AssertEx.SetEqual(fieldAttributesExpected, GetAttributeStrings(field2.GetAttributes())); 1944var attributes3 = field3.GetAttributes(); 2161Assert.Empty(prop1.GetAttributes()); 2165GetAttributeStrings(field1.GetAttributes())); 2168Assert.Empty(prop2.GetAttributes()); 2172GetAttributeStrings(field2.GetAttributes())); 2210Assert.Empty(prop1.GetAttributes()); 2215AssertEx.SetEqual(fieldAttributesExpected.Concat(decimalAttributeExpected), GetAttributeStrings(field1.GetAttributes())); 2219AssertEx.SetEqual(fieldAttributesExpected, GetAttributeStrings(field1.GetAttributes())); 2224Assert.Empty(prop2.GetAttributes()); 2227AssertEx.SetEqual(fieldAttributesExpected.Concat(decimalAttributeExpected), GetAttributeStrings(field2.GetAttributes())); 2232AssertEx.SetEqual(decimalAttributeExpected, GetAttributeStrings(field3.GetAttributes())); 2236Assert.Empty(GetAttributeStrings(field3.GetAttributes())); 2292Assert.Empty(prop1.GetAttributes()); 2296GetAttributeStrings(field1.GetAttributes())); 2302Assert.Empty(prop2.GetAttributes()); 2306GetAttributeStrings(field2.GetAttributes())); 2426Assert.Equal("A(2)", prop1.GetAttributes().Single().ToString()); 2427AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop1.GetMethod.GetAttributes())); 2428AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop1.SetMethod.GetAttributes())); 2431AssertEx.SetEqual(fieldAttributesExpected.Concat(new[] { "A(1)" }), GetAttributeStrings(field1.GetAttributes())); 2436Assert.Empty(prop2.GetAttributes()); 2437AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop2.GetMethod.GetAttributes())); 2438AssertEx.SetEqual(propAttributesExpected, GetAttributeStrings(prop2.SetMethod.GetAttributes())); 2441AssertEx.SetEqual(fieldAttributesExpected, GetAttributeStrings(field2.GetAttributes())); 2597AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event1.AddMethod.GetAttributes())); 2598AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event1.RemoveMethod.GetAttributes())); 2607AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event2.AddMethod.GetAttributes())); 2608AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event2.RemoveMethod.GetAttributes())); 2616AssertEx.SetEqual(accessorsExpected.Concat(new[] { "CC" }), GetAttributeNames(event3.AddMethod.GetAttributes())); 2617AssertEx.SetEqual(accessorsExpected.Concat(new[] { "CC" }), GetAttributeNames(event3.RemoveMethod.GetAttributes())); 2625AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event4.AddMethod.GetAttributes())); 2626AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event4.RemoveMethod.GetAttributes())); 2789return symbol.GetAttributes().Single().AttributeClass.Name; 2794Assert.Equal(0, symbol.GetAttributes().Length); 2863Assert.Equal(0, parameters[0].GetAttributes().Length); 2864Assert.Equal(0, parameters[1].GetAttributes().Length); 2987Assert.Equal(0, parameters[0].GetAttributes().Length); 2988Assert.Equal(0, parameters[1].GetAttributes().Length); 3059var attrs = m.GetAttributes(); 3065attrs = assembly.GetAttributes(); 3075attrs = field.GetAttributes(); 3082attrs = nenum.GetAttributes(); 3091attrs = nenum.GetMember("three").GetAttributes(); 3138var attrs = dele.GetAttributes(); 3144attrs = mem.Parameters[0].GetAttributes(); 3146attrs = mem.Parameters[1].GetAttributes(); 3178var attrs = type.GetMember<MethodSymbol>("F").GetAttributes(); 3226var attrs = cDoc.GetAttributes(); 3274var attrs = cDoc.GetAttributes(); 3326var attrs = cDoc.GetAttributes(); 3378var attrs = cDoc.GetAttributes(); 3412var attrs = type.GetAttributes(); 3423var attrs = type.GetAttributes(); 3549var attrs = type.GetAttributes(); 3560var attrs = type.GetAttributes(); 3595var attrs = type.GetAttributes(); 3641var attrs = type.GetAttributes(); 4038var attrs = type.GetAttributes(); 4054attrs = fieldSymbol.GetAttributes(); 4060attrs = fieldSymbol.GetAttributes(); 4096var attrs = type.GetAttributes(); 4139var attrs = type.GetAttributes(); 4183var attrs = type.GetAttributes(); 4228var attrs = type.GetAttributes(); 4272var attrs = type.GetAttributes(); 4603var ca = goo.GetAttributes().First().CommonConstructorArguments.First(); 4844Assert.Equal(2, type.GetAttributes().Length); 4881Assert.Equal(2, typeParameter.GetAttributes().Length); 5194var attrs = classC1.GetAttributes(); 5199attrs = classC2.GetAttributes(); 5204attrs = classC3.GetAttributes(); 5210attrs = classC4.GetAttributes(); 5217attrs = classC5.GetAttributes(); 5226attrs = classC6.GetAttributes(); 5318var attributes = field.GetAttributes(); 5456var attr = c.GetAttributes().Single(); 5500var attr = c.GetAttributes().Single(); 5532Assert.Empty(classTypeParameter.GetAttributes()); 5534var attribute = methodTypeParameter.GetAttributes().Single(); 8056var attrs = type.GetAttributes(); 8063var attrs = type.GetAttributes(); 8384Assert.Equal(0, assembly.GetAttributes().Length); 8386Assert.Equal(0, type.GetAttributes().Length); 8427Assert.Equal(0, assembly.GetAttributes().Length); 8429Assert.Equal(0, type.GetAttributes().Length); 8474Assert.Equal(0, assembly.GetAttributes().Length); 8476Assert.Equal(0, type.GetAttributes().Length); 8520Assert.Equal(0, yParam.GetAttributes().Length); 8557Assert.Equal(0, type.GetAttributes()[0].ConstructorArguments.Count()); 9113var attrs1 = method1.GetAttributes(); 9119var attrs2 = method2.GetAttributes(); 9124var attrs3 = method3.GetAttributes(); 9194var attrs1 = method1.GetAttributes(); 9201var attrs2 = method2.GetAttributes(); 9207var attrs3 = method3.GetAttributes(); 9213var attrs4 = method4.GetAttributes(); 9278var attrs1 = method1.GetAttributes(); 9284var attrs2 = method2.GetAttributes(); 9289var attrs3 = method3.GetAttributes(); 9294var attrs4 = method4.GetAttributes(); 9351var attrs1 = method1.GetAttributes(); 9356var attrs2 = method2.GetAttributes(); 9361var attrs3 = method3.GetAttributes(); 9425var attrs1 = method1.GetAttributes(); 9431var attrs2 = method2.GetAttributes(); 9437var attrs3 = method3.GetAttributes(); 9443var attrs4 = method4.GetAttributes(); 9505var attrs1 = method1.GetAttributes(); 9511var attrs2 = method2.GetAttributes(); 9516var attrs3 = method3.GetAttributes(); 9521var attrs4 = method4.GetAttributes(); 9571var attrs = methods.Select(m => m.GetAttributes().Single()).ToArray(); 9615var typeInAttribute = (INamedTypeSymbol)type.GetAttributes()[0].ConstructorArguments.First().Value; 9617Assert.True(((NamedTypeSymbol)type.GetAttributes()[0].ConstructorArguments.First().ValueInternal).IsUnboundGenericType); 9625typeInAttribute = (INamedTypeSymbol)type.GetAttributes()[0].ConstructorArguments.First().Value; 9627Assert.True(((NamedTypeSymbol)type.GetAttributes()[0].ConstructorArguments.First().ValueInternal).IsUnboundGenericType); 9699Assert.True(cc.TypeParameters.Single().GetAttributes().IsEmpty); 9700Assert.Equal("XAttribute", mm.TypeParameters.Single().GetAttributes().Single().ToString()); 9942Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 9946Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 9963Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 9971Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 9992Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 9996Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 10018Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 10022Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 10044Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 10048Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 10069var attribute = m.GetAttributes().Single(); 10716var attrs = lambda.GetAttributes(); 10851var attrs = program.GetAttributes(); 10945var attrs = holder.GetAttributes(); 10955var attrs = holder.GetAttributes(); 11006var attrs = module.ContainingAssembly.GetAttributes(); 11019var attrs = module.ContainingAssembly.GetAttributes(); 11078var attrs = c.GetAttributes();
Attributes\AttributeTests_Assembly.cs (17)
870var attrs = comp.Assembly.GetAttributes(); 893var attrs = comp.Assembly.GetAttributes(); 1021.GetAttributes() 1034.GetAttributes() 1082var attrs = consoleappCompilation.Assembly.GetAttributes(); 1125Assert.Equal(0, consoleappCompilation.Assembly.GetAttributes().Length); 1203var attrs = consoleappCompilation.Assembly.GetAttributes(); 1240Assert.Equal(0, consoleappCompilation.Assembly.GetAttributes().Length); 1283var attrs = consoleappCompilation.Assembly.GetAttributes(); 1331foreach (var a in module.ContainingAssembly.GetAttributes()) 1376var attrs = consoleappCompilation.Assembly.GetAttributes(); 1424var attrs = compilation.Assembly.GetAttributes(); 1435attrs = compilation.Assembly.GetAttributes(); 1443attrs = compilation.Assembly.GetAttributes(); 1839var attrs = moduleSymbol.ContainingAssembly.GetAttributes().Select(a => a.ToString()).ToArray(); 2130return assembly.GetAttributes().Where(data => data.IsTargetAttribute(assembly, AttributeDescription.AssemblyDescriptionAttribute)); 2242var attrs = m.ContainingAssembly.GetAttributes();
Attributes\AttributeTests_CallerInfoAttributes.cs (3)
2299var arguments = compilation.GetTypeByMetadataName("Program").GetAttributes().Single().CommonConstructorArguments; 4393var attr = ctor.Parameters.Single().GetAttributes().Single(); 4423var attr = ctor.Parameters.Single().GetAttributes()[0];
Attributes\AttributeTests_Conditional.cs (23)
142attributesArrayBuilder.Add(classZ.GetAttributes()); 143attributesArrayBuilder.Add(classZ.TypeParameters[0].GetAttributes()); 146attributesArrayBuilder.Add(methodM.GetAttributes()); 149attributesArrayBuilder.Add(param1.GetAttributes()); 152attributesArrayBuilder.Add(fieldF.GetAttributes()); 155attributesArrayBuilder.Add(propP1.GetAttributes()); 157attributesArrayBuilder.Add(propGetMethod.GetAttributes()); 160attributesArrayBuilder.Add(propSetMethod.GetAttributes()); 161attributesArrayBuilder.Add(propSetMethod.Parameters[0].GetAttributes()); 164attributesArrayBuilder.Add(propP2.GetAttributes()); 166attributesArrayBuilder.Add(propGetMethod.GetAttributes()); 170attributesArrayBuilder.Add(propP3.GetAttributes()); 172attributesArrayBuilder.Add(propGetMethod.GetAttributes()); 175attributesArrayBuilder.Add(propSetMethod.GetAttributes()); 176attributesArrayBuilder.Add(propSetMethod.Parameters[0].GetAttributes()); 179attributesArrayBuilder.Add(eventE.GetAttributes()); 180attributesArrayBuilder.Add(eventE.AddMethod.GetAttributes()); 181attributesArrayBuilder.Add(eventE.RemoveMethod.GetAttributes()); 184attributesArrayBuilder.Add(eventE.AssociatedField.GetAttributes()); 188attributesArrayBuilder.Add(enumE.GetAttributes()); 191attributesArrayBuilder.Add(fieldA.GetAttributes()); 194attributesArrayBuilder.Add(structS.GetAttributes()); 634var attributes = paramY.GetAttributes();
Attributes\AttributeTests_Dynamic.cs (64)
164ValidateDynamicAttribute(_base0Class.GetAttributes(), expectedDynamicAttribute: false); 167ValidateDynamicAttribute(_base1Class.GetAttributes(), expectedDynamicAttribute: false); 170ValidateDynamicAttribute(_base2Class.GetAttributes(), expectedDynamicAttribute: false); 176ValidateDynamicAttribute(_derivedClass.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 182ValidateDynamicAttribute(_outerClass.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 188ValidateDynamicAttribute(_innerClass.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 194ValidateDynamicAttribute(_innerInnerClass.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 200ValidateDynamicAttribute(_outer2Class.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 204ValidateDynamicAttribute(_inner2Class.GetAttributes(), expectedDynamicAttribute: false); 208ValidateDynamicAttribute(_innerInner2Class.GetAttributes(), expectedDynamicAttribute: false); 211ValidateDynamicAttribute(_inner3Class.GetAttributes(), expectedDynamicAttribute: false); 221ValidateDynamicAttribute(field1.GetAttributes(), expectedDynamicAttribute: true); 227ValidateDynamicAttribute(field2.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 233ValidateDynamicAttribute(field3.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 238ValidateDynamicAttribute(field4.GetAttributes(), expectedDynamicAttribute: true); 244ValidateDynamicAttribute(field5.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 250ValidateDynamicAttribute(field6.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 256ValidateDynamicAttribute(field7.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 262ValidateDynamicAttribute(field8.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 268ValidateDynamicAttribute(field9.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 274ValidateDynamicAttribute(field10.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 280ValidateDynamicAttribute(field11.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 286ValidateDynamicAttribute(field12.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 292ValidateDynamicAttribute(field13.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 298ValidateDynamicAttribute(field14.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 304ValidateDynamicAttribute(field15.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 310ValidateDynamicAttribute(field16.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 316ValidateDynamicAttribute(field17.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 322ValidateDynamicAttribute(field1.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 329ValidateDynamicAttribute(f1.GetAttributes(), expectedDynamicAttribute: false); 335ValidateDynamicAttribute(f1.Parameters[0].GetAttributes(), expectedDynamicAttribute: true); 339ValidateDynamicAttribute(f2.GetAttributes(), expectedDynamicAttribute: false); 346ValidateDynamicAttribute(f2.Parameters[0].GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 350ValidateDynamicAttribute(f3.GetAttributes(), expectedDynamicAttribute: false); 356ValidateDynamicAttribute(f3.Parameters[0].GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 360ValidateDynamicAttribute(f4.GetAttributes(), expectedDynamicAttribute: false); 367ValidateDynamicAttribute(f4.Parameters[0].GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 371ValidateDynamicAttribute(f5.GetAttributes(), expectedDynamicAttribute: false); 378ValidateDynamicAttribute(f5.Parameters[0].GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 386ValidateDynamicAttribute(prop1.GetAttributes(), expectedDynamicAttribute: true); 397ValidateDynamicAttribute(prop2.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 407ValidateDynamicAttribute(prop2.SetMethod.Parameters[0].GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 415ValidateDynamicAttribute(indexer.GetAttributes(), expectedDynamicAttribute: true); 423ValidateDynamicAttribute(indexer.GetMethod.Parameters[0].GetAttributes(), expectedDynamicAttribute: true); 431ValidateDynamicAttribute(indexer.SetMethod.Parameters[0].GetAttributes(), expectedDynamicAttribute: true); 432ValidateDynamicAttribute(indexer.SetMethod.Parameters[1].GetAttributes(), expectedDynamicAttribute: true); 442ValidateDynamicAttribute(_unsafeClass.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 451ValidateDynamicAttribute(nullableField.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: _expectedTransformFlags); 460ValidateDynamicAttribute(_synthesizedMyDelegateType.GetAttributes(), expectedDynamicAttribute: false); 470ValidateDynamicAttribute(ctor.GetAttributes(), expectedDynamicAttribute: false); 474ValidateDynamicAttribute(param.GetAttributes(), expectedDynamicAttribute: false); 482ValidateDynamicAttribute(invokeMethod.GetAttributes(), expectedDynamicAttribute: false); 488ValidateDynamicAttribute(invokeMethod.Parameters[0].GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 498ValidateDynamicAttribute(beginInvokeMethod.GetAttributes(), expectedDynamicAttribute: false); 503ValidateDynamicAttribute(parameters[0].GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformFlags); 504ValidateDynamicAttribute(parameters[1].GetAttributes(), expectedDynamicAttribute: false); 505ValidateDynamicAttribute(parameters[2].GetAttributes(), expectedDynamicAttribute: false); 512ValidateDynamicAttribute(endInvokeMethod.GetAttributes(), expectedDynamicAttribute: false); 516ValidateDynamicAttribute(endInvokeMethod.Parameters[0].GetAttributes(), expectedDynamicAttribute: false); 828DynamicAttributeValidator.ValidateDynamicAttribute(implicitField.GetAttributes(), expectedDynamicAttribute: true); 861DynamicAttributeValidator.ValidateDynamicAttribute(implicitField.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformsFlags); 896DynamicAttributeValidator.ValidateDynamicAttribute(implicitField.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformsFlags); 918DynamicAttributeValidator.ValidateDynamicAttribute(implicitField.GetAttributes(), expectedDynamicAttribute: true, expectedTransformFlags: expectedTransformsFlags); 1095var attrs = getEnumerator.GetAttributes();
Attributes\AttributeTests_IsByRefLike.cs (5)
623AssertNotReferencedIsByRefLikeAttribute(property.Type.GetAttributes()); 674var attribute = type.GetAttributes().Single(); 759var attribute = type.GetAttributes().Single(); 810var attributes = type.GetAttributes(); 1095var attributes = typeSymbol.GetAttributes().OrderBy(attribute => attribute.AttributeClass.Name).ToArray();
Attributes\AttributeTests_IsUnmanaged.cs (1)
833var isUnmanagedTypeAttributes = attributeType.GetAttributes().OrderBy(attribute => attribute.AttributeClass.Name).ToArray();
Attributes\AttributeTests_NativeInteger.cs (4)
1109AssertNativeIntegerAttribute(method.Parameters[0].GetAttributes()); 1133AssertAttributes(method.GetAttributes(), "System.Runtime.CompilerServices.CompilerGeneratedAttribute"); 1156AssertNativeIntegerAttribute(method.Parameters[0].GetAttributes()); 1493var attributes = member.GetAttributes();
Attributes\AttributeTests_Nullable.cs (28)
528CompileAndVerify(comp, symbolValidator: m => CheckAttribute(m.GlobalNamespace.GetMember("A.F").GetAttributes().Single(), "A")); 538CompileAndVerify(comp, symbolValidator: m => CheckAttribute(m.GlobalNamespace.GetMember("B.G").GetAttributes().Single(), "B")); 563CompileAndVerify(comp, symbolValidator: m => CheckAttribute(m.GlobalNamespace.GetMember("A.F").GetAttributes().Single(), "A")); 573CompileAndVerify(comp, symbolValidator: m => CheckAttribute(m.GlobalNamespace.GetMember("B.G").GetAttributes().Single(), "A")); 803AssertNoNullableAttribute(field.GetAttributes()); 804AssertNoNullableAttribute(module.GetAttributes()); 805AssertAttributes(assembly.GetAttributes(), 817AssertNoNullableAttribute(field.GetAttributes()); 818AssertNoNullableAttribute(module.GetAttributes()); 819AssertAttributes(assembly.GetAttributes(), 976AssertNullableAttribute(field.GetAttributes()); 977AssertNoNullableAttribute(module.GetAttributes()); 978AssertAttributes(assembly.GetAttributes(), 1007AssertAttributes(module.GetAttributes()); 2170AssertAttributes(method.GetAttributes()); 2197AssertAttributes(method.GetAttributes(), "System.Runtime.CompilerServices.NullableContextAttribute"); 2198AssertAttributes(method.Parameters[0].GetAttributes()); 2225AssertAttributes(method.Parameters[0].GetAttributes()); 2226AssertNullableAttribute(method.Parameters[1].GetAttributes()); 2278AssertAttributes(method.GetAttributes(), "System.Runtime.CompilerServices.CompilerGeneratedAttribute"); 2301AssertNullableAttribute(method.Parameters[0].GetAttributes()); 2302AssertNoNullableAttribute(method.Parameters[1].GetAttributes()); 2511AssertNoNullableAttribute(method.GetAttributes()); 2535AssertNoNullableAttribute(property.GetAttributes()); 2538AssertAttributes(method.GetAttributes(), "System.Diagnostics.DebuggerHiddenAttribute"); 2561AssertNoNullableAttribute(property.GetAttributes()); 2564AssertAttributes(method.GetAttributes(), "System.Diagnostics.DebuggerHiddenAttribute"); 4996var attributes = method.Parameters[0].GetAttributes();
Attributes\AttributeTests_NullablePublicOnly.cs (1)
587var attribute = module.GetAttributes().SingleOrDefault();
Attributes\AttributeTests_ReadOnlyStruct.cs (10)
41Assert.Empty(type.GetAttributes()); 60Assert.Empty(type.GetAttributes()); 78Assert.Empty(type.GetAttributes()); 96Assert.Empty(type.GetAttributes()); 114Assert.Empty(type.GetAttributes()); 140Assert.Empty(type.GetAttributes()); 436Assert.Empty(type.GetAttributes()); 586AssertNotReferencedIsReadOnlyAttribute(type.GetAttributes()); 615AssertNotReferencedIsReadOnlyAttribute(property.Type.GetAttributes()); 662var attributes = typeSymbol.GetAttributes().OrderBy(attribute => attribute.AttributeClass.Name).ToArray();
Attributes\AttributeTests_RefReadOnly.cs (87)
44Assert.Empty(parameter.GetAttributes()); 69Assert.Empty(parameter.GetAttributes()); 126Assert.Empty(parameter.GetAttributes()); 155Assert.Empty(parameter.GetAttributes()); 177Assert.Empty(parameter.GetAttributes()); 207Assert.Empty(parameter.GetAttributes()); 234Assert.Empty(parameter.GetAttributes()); 251Assert.Empty(parameter.GetAttributes()); 278Assert.Empty(parameter.GetAttributes()); 313Assert.Empty(property.GetAttributes()); 342Assert.Empty(property.GetAttributes()); 378Assert.Empty(property.GetAttributes()); 408Assert.Empty(parameter.GetAttributes()); 409Assert.Empty(indexer.GetAttributes()); 428Assert.Empty(parameter.GetAttributes()); 449Assert.Empty(indexer.GetAttributes()); 480Assert.Empty(parameter.GetAttributes()); 481Assert.Empty(indexer.GetAttributes()); 507Assert.Empty(parameter.GetAttributes()); 523Assert.Empty(parameter.GetAttributes()); 567Assert.Empty(parameter.GetAttributes()); 604Assert.Empty(parameter.GetAttributes()); 627Assert.Empty(parameter.GetAttributes()); 692Assert.Empty(parameter.GetAttributes()); 731Assert.Empty(parameter.GetAttributes()); 758Assert.Empty(parameter.GetAttributes()); 825Assert.Empty(parameter.GetAttributes()); 1162Assert.Empty(parameter.GetAttributes()); 1313Assert.Empty(parameter.GetAttributes()); 1350Assert.Empty(parameter.GetAttributes()); 1593Assert.Empty(method.Parameters.Single().GetAttributes()); 1596Assert.Empty(@operator.Parameters[0].GetAttributes()); 1597Assert.Empty(@operator.Parameters[1].GetAttributes()); 1600Assert.Empty(property.GetAttributes()); 1603Assert.Empty(indexer.GetAttributes()); 1604Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1635Assert.Empty(method.Parameters.Single().GetAttributes()); 1638Assert.Empty(@operator.Parameters[0].GetAttributes()); 1639Assert.Empty(@operator.Parameters[1].GetAttributes()); 1642Assert.Empty(property.GetAttributes()); 1645Assert.Empty(indexer.GetAttributes()); 1646Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1679Assert.Empty(method.Parameters.Single().GetAttributes()); 1682Assert.Empty(@operator.Parameters[0].GetAttributes()); 1683Assert.Empty(@operator.Parameters[1].GetAttributes()); 1686Assert.Empty(property.GetAttributes()); 1689Assert.Empty(indexer.GetAttributes()); 1690Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1728Assert.Empty(method.Parameters.Single().GetAttributes()); 1731Assert.Empty(property.GetAttributes()); 1734Assert.Empty(indexer.GetAttributes()); 1735Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1775Assert.Empty(method.Parameters.Single().GetAttributes()); 1778Assert.Empty(property.GetAttributes()); 1781Assert.Empty(indexer.GetAttributes()); 1782Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1819Assert.Empty(method.Parameters.Single().GetAttributes()); 1822Assert.Empty(property.GetAttributes()); 1825Assert.Empty(indexer.GetAttributes()); 1826Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1868Assert.Empty(method.Parameters.Single().GetAttributes()); 1871Assert.Empty(property.GetAttributes()); 1874Assert.Empty(indexer.GetAttributes()); 1875Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1908Assert.Empty(method.Parameters.Single().GetAttributes()); 1911Assert.Empty(@operator.Parameters[0].GetAttributes()); 1912Assert.Empty(@operator.Parameters[1].GetAttributes()); 1915Assert.Empty(property.GetAttributes()); 1918Assert.Empty(indexer.GetAttributes()); 1919Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1977Assert.Empty(method.Parameters.Single().GetAttributes()); 1980Assert.Empty(property.GetAttributes()); 1983Assert.Empty(indexer.GetAttributes()); 1984Assert.Empty(indexer.Parameters.Single().GetAttributes()); 2026Assert.Empty(method.Parameters.Single().GetAttributes()); 2029Assert.Empty(property.GetAttributes()); 2032Assert.Empty(indexer.GetAttributes()); 2033Assert.Empty(indexer.Parameters.Single().GetAttributes()); 2066Assert.Empty(method.Parameters.Single().GetAttributes()); 2069Assert.Empty(property.GetAttributes()); 2072Assert.Empty(indexer.GetAttributes()); 2073Assert.Empty(indexer.Parameters.Single().GetAttributes()); 2108Assert.Empty(method.Parameters.Single().GetAttributes()); 2111Assert.Empty(property.GetAttributes()); 2114Assert.Empty(indexer.GetAttributes()); 2115Assert.Empty(indexer.Parameters.Single().GetAttributes()); 2554var attributes = typeSymbol.GetAttributes().OrderBy(attribute => attribute.AttributeClass.Name).ToArray();
Attributes\AttributeTests_RefSafetyRules.cs (1)
222var attribute = module.GetAttributes().SingleOrDefault();
Attributes\AttributeTests_Synthesized.cs (69)
130var actualAttrs = GetAttributeNames(pid.GetAttributes()); 152var actualAttrs = GetAttributeNames(bufferType.GetAttributes()); 265AssertEx.SetEqual(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(displayClass.GetAttributes())); 269Assert.Equal(0, member.GetAttributes().Length); 304AssertEx.SetEqual(expected, GetAttributeNames(anon.GetAttributes())); 308var actual = GetAttributeNames(member.GetAttributes()); 405var dd = anon.GetAttributes().Where(a => a.AttributeClass.Name == "DebuggerDisplayAttribute").Single(); 431AssertEx.SetEqual(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(iter.GetAttributes())); 444AssertEx.SetEqual(new[] { "DebuggerHiddenAttribute" }, GetAttributeNames(member.GetAttributes())); 450AssertEx.SetEqual(new string[] { }, GetAttributeNames(member.GetAttributes())); 488new[] { "AsyncStateMachineAttribute" }, GetAttributeNames(goo.GetAttributes())); 491AssertEx.SetEqual(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(iter.GetAttributes())); 501AssertEx.SetEqual(new[] { "DebuggerHiddenAttribute" }, GetAttributeNames(member.GetAttributes())); 505AssertEx.SetEqual(new string[] { }, GetAttributeNames(member.GetAttributes())); 543var attributes = module.GlobalNamespace.GetTypeMember("B").GetMember<MethodSymbol>("<>n__0").GetAttributes(); 582AssertEx.SetEqual(new[] { "CompilerGeneratedAttribute", "DebuggerHiddenAttribute" }, GetAttributeNames(baseMethodWrapper.GetAttributes())); 586Assert.Empty(parameter.GetAttributes()); 625AssertEx.SetEqual(new[] { "CompilerGeneratedAttribute", "DebuggerHiddenAttribute" }, GetAttributeNames(baseMethodWrapper.GetAttributes())); 629Assert.Empty(parameter.GetAttributes()); 632Assert.Empty(typeParameter.GetAttributes()); 652Assert.Equal(new[] { "Attr" }, GetAttributeNames(typeParam.GetAttributes())); 703Assert.Empty(ctor[1].GetAttributes()); // shouldn't have attribute. 709Assert.Empty(myProperty.GetAttributes()); 720var attributeNames = GetAttributeNames(symbol.GetAttributes()); 763Assert.Empty(ctor.GetAttributes()); 766Assert.Empty(myProperty.GetAttributes()); 777var attributeNames = GetAttributeNames(symbol.GetAttributes()); 845Assert.Empty(ctor[0].GetAttributes()); 854Assert.Empty(p1.GetAttributes()); 859var attributeNames = GetAttributeNames(symbol.GetAttributes()); 885Assert.Empty(ctor[0].GetAttributes()); 886Assert.Empty(ctor[1].GetAttributes()); 918Assert.Empty(p1.GetAttributes()); 923var attributeNames = GetAttributeNames(symbol.GetAttributes()); 946Assert.Empty(ctor.GetAttributes()); 949Assert.Empty(toString.GetAttributes()); 952Assert.Empty(op_Equality.GetAttributes()); 955Assert.Empty(op_Inequality.GetAttributes()); 958Assert.Empty(getHashCode.GetAttributes()); 962Assert.Empty(equals[0].GetAttributes()); 963Assert.Empty(equals[1].GetAttributes()); 984var attributes = module.ContainingAssembly.GetAttributes(); 1019var attributes = module.ContainingAssembly.GetAttributes(); 1054var attributes = module.ContainingAssembly.GetAttributes(); 1089var attributes = module.ContainingAssembly.GetAttributes(); 1126VerifyDebuggableAttribute(module.GetAttributes().Single(), optimizationLevel, isSynthesized: false); 1128var attributes = module.ContainingAssembly.GetAttributes(); 1164var attributes = module.ContainingAssembly.GetAttributes(); 1200VerifyCompilationRelaxationsAttribute(module.GetAttributes().Single(), isSynthesized: false); 1202var assemblyAttributes = module.ContainingAssembly.GetAttributes(); 1238VerifyDebuggableAttribute(module.GetAttributes().Single(), options.OptimizationLevel, isSynthesized: false); 1240var assemblyAttributes = module.ContainingAssembly.GetAttributes(); 1280var assemblyAttributes = module.ContainingAssembly.GetAttributes(); 1310var attributes = module.ContainingAssembly.GetAttributes(); 1359var attributes = module.ContainingAssembly.GetAttributes(); 1406var attributes = module.ContainingAssembly.GetAttributes(); 1450var attributes = module.ContainingAssembly.GetAttributes(); 1495var assemblyAttributes = module.ContainingAssembly.GetAttributes(); 1535var attributes = module.ContainingAssembly.GetAttributes(); 1576var attributes = module.ContainingAssembly.GetAttributes(); 1613var unverifiableCode = module.GetAttributes().Single(); 1680var attributes = asyncMethod.GetAttributes(); 1723var attributes = asyncMethod.GetAttributes(); 1765var attributes = asyncMethod.GetAttributes(); 1812Assert.Equal("DebuggerStepThroughAttribute", asyncMethod.GetAttributes().Single().AttributeClass.Name); 1816Assert.Empty(asyncMethod.GetAttributes()); 1846var iteratorAttribute = iteratorMethod.GetAttributes().Single(); 1876var iteratorAttribute = iteratorMethod.GetAttributes().Single(); 1907Assert.Empty(type.GetMember<MethodSymbol>("F").GetAttributes());
Attributes\AttributeTests_Tuples.cs (30)
349ValidateTupleNameAttribute(invokeMethod.GetAttributes(), expectedTupleNamesAttribute: false); 355ValidateTupleNameAttribute(sender.GetAttributes(), expectedTupleNamesAttribute: false); 364ValidateTupleNameAttribute(args.GetAttributes(), 369args.GetAttributes(), 386ValidateTupleNameAttribute(event1.GetAttributes(), 393event1.GetAttributes(), 405ValidateTupleNameAttribute(_base0Class.GetAttributes(), expectedTupleNamesAttribute: false); 408ValidateTupleNameAttribute(_base1Class.GetAttributes(), expectedTupleNamesAttribute: false); 411ValidateTupleNameAttribute(_base2Class.GetAttributes(), expectedTupleNamesAttribute: false); 416ValidateTupleNameAttribute(_outerClass.GetAttributes(), 429ValidateTupleNameAttribute(_derivedClass.GetAttributes(), 439ValidateTupleNameAttribute(field1.GetAttributes(), expectedTupleNamesAttribute: true, expectedElementNames: expectedElementNames); 444ValidateTupleNameAttribute(field2.GetAttributes(), expectedTupleNamesAttribute: true, expectedElementNames: expectedElementNames); 449ValidateTupleNameAttribute(field3.GetAttributes(), expectedTupleNamesAttribute: true, expectedElementNames: expectedElementNames); 454ValidateTupleNameAttribute(field4.GetAttributes(), expectedTupleNamesAttribute: true, expectedElementNames: expectedElementNames); 456field4.GetAttributes(), 469ValidateTupleNameAttribute(field5.GetAttributes(), 473field5.GetAttributes(), 484ValidateTupleNameAttribute(field6.GetAttributes(), expectedTupleNamesAttribute: false); 499ValidateTupleNameAttribute(field7.GetAttributes(), expectedTupleNamesAttribute: false); 510ValidateTupleNameAttribute(field8.GetAttributes(), expectedTupleNamesAttribute: true, 520ValidateTupleNameAttribute(field9.GetAttributes(), expectedTupleNamesAttribute: true, 536ValidateTupleNameAttribute(method2.Parameters.Single().GetAttributes(), 547ValidateTupleNameAttribute(method3.Parameters.Single().GetAttributes(), 558ValidateTupleNameAttribute(method4.Parameters.Single().GetAttributes(), 571ValidateTupleNameAttribute(method5.Parameters.Single().GetAttributes(), expectedTupleNamesAttribute: false); 590ValidateTupleNameAttribute(prop1.GetAttributes(), 597ValidateTupleNameAttribute(prop2.GetAttributes(), 604ValidateTupleNameAttribute(indexer.GetAttributes(), 608ValidateTupleNameAttribute(indexer.Parameters.Single().GetAttributes(),
Attributes\AttributeTests_WellKnownAttributes.cs (38)
134var attrs = assembly.GetAttributes(); 155Assert.Equal(6, igoo.GetAttributes().Length); 181Assert.Equal(1, mem.GetAttributes().Length); 182attrSym = mem.GetAttributes().First(); 187attrSym = mem.GetAttributes().First(); 192Assert.Equal(1, mem.GetAttributes().Length); 195attrSym = mem.GetAttributes().First(); 263Assert.Equal(2, type1.GetAttributes().Length); 279Assert.Equal(2, type2.GetAttributes().Length); 303Assert.Equal(2, type3.GetAttributes().Length); 312Assert.Equal(0, field.GetAttributes().Length); 315Assert.Equal(1, field.GetAttributes().Length); 316attrSym = field.GetAttributes().First(); 320attrSym = field.GetAttributes().First(); 422Assert.Equal(3, parm.GetAttributes().Length); 433Assert.Equal(3, parm.GetAttributes().Length); 443attrSym = method.GetAttributes().First(); 447attrSym = parm.GetAttributes().First(); 452attrSym = parm.GetAttributes().First(); 463Assert.Equal(2, type2.GetAttributes().Length); 476Assert.Equal(3, field.GetAttributes().Length); 873Assert.Equal(0, ps[0].GetAttributes().Length); 903Assert.Equal(0, ps[0].GetAttributes().Length); 932Assert.Equal(0, ps[0].GetAttributes().Length); 2397var attrSym = method.GetAttributes().First(); 2405attrSym = method.GetAttributes().First(); 3595Assert.Equal(2, typeA.GetAttributes().Length); 3609Assert.Equal(1, typeA.GetAttributes().Length); 3675var attrs = worksheetInterface.GetAttributes().AsEnumerable(); 3806var attrs = worksheetInterface.GetAttributes().AsEnumerable(); 4811AssertEx.SetEqual(expectedAttributes, typeC.GetAttributes().Select(a => a.ToString())); 4990Assert.Empty(noParamsParameter.GetAttributes()); 5555Assert.Equal(0, typeA.GetAttributes().Length); 5621Assert.Equal(0, method.GetAttributes().Length); 5664Assert.Equal(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(method.GetAttributes())); 13051GetMember<MethodSymbol>("MoveNext").GetAttributes().Length); 13061GetMember<MethodSymbol>("MoveNext").GetAttributes().Length); 13365var attribute = module.ContainingAssembly.GetTypeByMetadataName("Program").GetMethod("Test").Parameters.Single().GetAttributes().Single();
Attributes\InternalsVisibleToAndStrongNameTests.cs (3)
110foreach (var attrData in m.ContainingAssembly.GetAttributes()) 224foreach (var attrData in m.ContainingAssembly.GetAttributes()) 2749Assert.False(assembly.GetAttributes().Any(attr => attr.IsTargetAttribute(assembly, AttributeDescription.InternalsVisibleToAttribute)));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (376)
Semantics\BindingTests.cs (3)
2570var a = x.GetAttributes()[0]; 2600var a = foo.GetAttributes()[0]; 2630var a = tt.GetAttributes()[0];
Semantics\InitOnlyMemberTests.cs (4)
1453var propertyAttributes = property.GetAttributes().Select(a => a.ToString()); 1460var getterAttributes = getter.GetAttributes().Select(a => a.ToString()); 1473var setterAttributes = property.SetMethod.GetAttributes().Select(a => a.ToString()); 1488var backingFieldAttributes = backingField.GetAttributes().Select(a => a.ToString());
Semantics\InterpolationTests.cs (45)
4991Assert.Equal("Attr..ctor(CustomHandler c)", attr.GetAttributes().Single().AttributeConstructor.ToTestDisplayString()); 5016Assert.Equal("Attr..ctor(System.String s)", attr.GetAttributes().Single().AttributeConstructor.ToTestDisplayString()); 6796sParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6822sParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6854cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6889cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6929cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6964cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7004cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7042cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7082cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7117cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7157cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7192cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7225cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7265cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7305cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7345cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7385cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7420cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7462cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7497cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7539cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7580cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7620cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7688cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7782cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7894cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7960cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7990cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8163cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8223cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8343cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8573cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8698cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8849cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8960cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 9027cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 9083cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 9199cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 9315cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 9440cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 9702cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 9778cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 11836cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString());
Semantics\LambdaTests.cs (2)
3629return format(expr, method.GetAttributes(), method.GetReturnTypeAttributes(), method.Parameters.SelectMany(p => p.GetAttributes()));
Semantics\LocalFunctionTests.cs (4)
1723var attrs = typeParam.GetAttributes(); 1928var attrs = typeParam.GetAttributes(); 1978var attrs = param.GetAttributes(); 1984attrs = param.GetAttributes();
Semantics\MultiDimensionalArrayTests.cs (4)
1681var a1 = (IArrayTypeSymbol)p.GetMember<MethodSymbol>("Test1").GetAttributes().Single().ConstructorArguments.Single().Value; 1686var a2 = (IArrayTypeSymbol)p.GetMember<MethodSymbol>("Test2").GetAttributes().Single().ConstructorArguments.Single().Value; 1691Assert.True(((ITypeSymbol)p.GetMember<MethodSymbol>("Test3").GetAttributes().Single().ConstructorArguments.Single().Value).IsErrorType()); 1692Assert.True(((ITypeSymbol)p.GetMember<MethodSymbol>("Test4").GetAttributes().Single().ConstructorArguments.Single().Value).IsErrorType());
Semantics\NamedAndOptionalTests.cs (34)
2056Assert.Equal(0, parameters[0].GetAttributes().Length); 2062Assert.Equal(0, parameters[1].GetAttributes().Length); 2068Assert.Equal(0, parameters[2].GetAttributes().Length); 2074Assert.Equal(isFromSource ? 1 : 0, parameters[3].GetAttributes().Length); 2081Assert.Equal(isFromSource ? 1 : 0, parameters[4].GetAttributes().Length); 2088Assert.Equal(isFromSource ? 1 : 0, parameters[5].GetAttributes().Length); 2094Assert.Equal(isFromSource ? 2 : 0, parameters[6].GetAttributes().Length); 2100Assert.Equal(isFromSource ? 2 : 0, parameters[7].GetAttributes().Length); 2138Assert.Equal(0, parameters[0].GetAttributes().Length); 2144Assert.Equal(0, parameters[1].GetAttributes().Length); 2150Assert.Equal(isFromSource ? 1 : 0, parameters[2].GetAttributes().Length); 2189Assert.Equal(0, parameters[0].GetAttributes().Length); 2195Assert.Equal(0, parameters[1].GetAttributes().Length); 2201Assert.Equal(0, parameters[2].GetAttributes().Length); 2207Assert.Equal(isFromSource ? 1 : 0, parameters[3].GetAttributes().Length); 2214Assert.Equal(isFromSource ? 1 : 0, parameters[4].GetAttributes().Length); 2220Assert.Equal(isFromSource ? 2 : 0, parameters[5].GetAttributes().Length); 2227Assert.Equal(isFromSource ? 1 : 0, parameters[6].GetAttributes().Length); 2233Assert.Equal(isFromSource ? 2 : 0, parameters[7].GetAttributes().Length); 2272Assert.Equal(0, parameters[0].GetAttributes().Length); 2278Assert.Equal(0, parameters[1].GetAttributes().Length); 2284Assert.Equal(0, parameters[2].GetAttributes().Length); 2290Assert.Equal(isFromSource ? 1 : 0, parameters[3].GetAttributes().Length); 2297Assert.Equal(1, parameters[4].GetAttributes().Length); // DecimalConstantAttribute 2304Assert.Equal(1, parameters[5].GetAttributes().Length); // DecimalConstantAttribute 2310Assert.Equal(isFromSource ? 2 : 0, parameters[6].GetAttributes().Length); // Optional+DecimalConstantAttribute / DecimalConstantAttribute 2316Assert.Equal(isFromSource ? 2 : 0, parameters[7].GetAttributes().Length); // Optional+DecimalConstantAttribute / DecimalConstantAttribute 2354Assert.Equal(0, parameters[0].GetAttributes().Length); 2360Assert.Equal(0, parameters[1].GetAttributes().Length); // As in dev11, [DateTimeConstant] is not emitted in this case. 2366Assert.Equal(isFromSource ? 1 : 0, parameters[2].GetAttributes().Length); 2373Assert.Equal(1, parameters[3].GetAttributes().Length); // DateTimeConstant 2380Assert.Equal(1, parameters[4].GetAttributes().Length); // DateTimeConstant 2386Assert.Equal(isFromSource ? 2 : 0, parameters[5].GetAttributes().Length); // Optional+DateTimeConstant / DateTimeConstant 2392Assert.Equal(isFromSource ? 2 : 0, parameters[6].GetAttributes().Length); // Optional+DateTimeConstant / DateTimeConstant
Semantics\NullableReferenceTypesTests.cs (211)
6456var attribute = c.GetAttributes().Single(); 6478var attribute = c.GetAttributes().Single(); 28234var copenAttributes = copen.GetAttributes().Select(a => a.ToString()); 28245var propertyAttributes = property.GetAttributes().Select(a => a.ToString()); 28256var getterAttributes = getter.GetAttributes().Select(a => a.ToString()); 28278var setterAttributes = setter.GetAttributes(); 28337var copenAttributes = copen.GetAttributes().Select(a => a.ToString()); 28348var propertyAttributes = property.GetAttributes().Select(a => a.ToString()); 28359var getterAttributes = getter.GetAttributes().Select(a => a.ToString()); 28861var fieldAttributes = field.GetAttributes().Select(a => a.ToString()); 38720var fieldAttributes = field.GetAttributes().Select(a => a.ToString()); 38894var copenAttributes = copen.GetAttributes().Select(a => a.ToString()); 38905var propertyAttributes = property.GetAttributes().Select(a => a.ToString()); 38916var setterAttributes = setter.GetAttributes(); 38919var setterValueAttributes = setter.Parameters.Last().GetAttributes().Select(a => a.ToString()); 38955var copenAttributes = copen.GetAttributes().Select(a => a.ToString()); 38966var propertyAttributes = property.GetAttributes().Select(a => a.ToString()); 38977var setterAttributes = setter.GetAttributes(); 38980var setterValueAttributes = setter.Parameters.Last().GetAttributes().Select(a => a.ToString()); 42575var copenAttributes = copen.GetAttributes().Select(a => a.ToString()); 42586var propertyAttributes = property.GetAttributes().Select(a => a.ToString()); 42597var setterAttributes = setter.GetAttributes().Select(a => a.ToString()); 42607var setterValueAttributes = setter.Parameters.Last().GetAttributes().Select(a => a.ToString()); 42824var fieldAttributes = field.GetAttributes().Select(a => a.ToString()); 45857var copenAttributes = copen.GetAttributes().Select(a => a.ToString()); 45868var propertyAttributes = property.GetAttributes().Select(a => a.ToString()); 45879Assert.Empty(getter.GetAttributes()); 45969var fieldAttributes = field.GetAttributes().Select(a => a.ToString()); 93915Assert.Empty(b.GetAttributes()); 93919Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", b.GetAttributes().First().ToString()); 93925Assert.Empty(t1.GetAttributes()); 93937Assert.Empty(t2.GetAttributes()); 93941Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t2.GetAttributes().Single().ToString()); 93978Assert.Empty(t1.GetAttributes()); 93982Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(1)", t1.GetAttributes().Single().ToString()); 93991Assert.Empty(t2.GetAttributes()); 93995Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t2.GetAttributes().Single().ToString()); 94036Assert.Empty(t1.GetAttributes()); 94042Assert.Empty(t2.GetAttributes()); 94085Assert.Empty(t1.GetAttributes()); 94089Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t1.GetAttributes().Single().ToString()); 94098Assert.Empty(t2.GetAttributes()); 94102Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t2.GetAttributes().Single().ToString()); 94694Assert.Empty(bf1.GetAttributes()); 94698Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 94702Assert.Empty(t11.GetAttributes()); 94708Assert.Empty(bf2.GetAttributes()); 94712Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", bf2.GetAttributes().Single().ToString()); 94717Assert.Empty(t22.GetAttributes()); 94885Assert.Empty(bf1.GetAttributes()); 94889Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 94893Assert.Empty(t11.GetAttributes()); 94899Assert.Empty(bf2.GetAttributes()); 94903Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", bf2.GetAttributes().Single().ToString()); 94908Assert.Empty(t22.GetAttributes()); 94992Assert.Empty(bf1.GetAttributes()); 94996Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 95000Assert.Empty(t11.GetAttributes()); 95006Assert.Empty(bf2.GetAttributes()); 95010Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", bf2.GetAttributes().Single().ToString()); 95015Assert.Empty(t22.GetAttributes()); 95058Assert.Empty(bf1.GetAttributes()); 95062Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 95066Assert.Empty(t11.GetAttributes()); 95072Assert.Empty(bf2.GetAttributes()); 95076CSharpAttributeData nullableAttribute = bf2.GetAttributes().Single(); 95084Assert.Empty(t22.GetAttributes()); 95130Assert.Empty(bf1.GetAttributes()); 95134Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 95139Assert.Empty(t11.GetAttributes()); 95145Assert.Empty(bf2.GetAttributes()); 95149CSharpAttributeData nullableAttribute = bf2.GetAttributes().Single(); 95156Assert.Empty(t22.GetAttributes()); 95199Assert.Empty(bf1.GetAttributes()); 95203Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 95207Assert.Empty(t11.GetAttributes()); 95213Assert.Empty(bf2.GetAttributes()); 95217Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", bf2.GetAttributes().Single().ToString()); 95222Assert.Empty(t22.GetAttributes()); 95289Assert.Empty(f2.GetAttributes()); 95293Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", f2.GetAttributes().Single().ToString()); 95297Assert.Empty(t2.GetAttributes()); 95324Assert.Empty(t2.GetAttributes()); 95328Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t2.GetAttributes().Single().ToString()); 95365Assert.Empty(t2.GetAttributes()); 95573Assert.Empty(bf1.GetAttributes()); 95577Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 95581Assert.Empty(t11.GetAttributes()); 95587Assert.Empty(bf2.GetAttributes()); 95591Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", bf2.GetAttributes().Single().ToString()); 95596Assert.Empty(t22.GetAttributes()); 96567Assert.Empty(f1.GetAttributes()); 96571Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", f1.GetAttributes().Single().ToString()); 96576var attributes = t1.GetAttributes(); 96605Assert.Empty(f1.GetAttributes()); 96609Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", f1.GetAttributes().Single().ToString()); 96615var attributes = t1.GetAttributes(); 96658Assert.Empty(t1.GetAttributes()); 96665Assert.Empty(t2.GetAttributes()); 96697Assert.Empty(t1.GetAttributes()); 96717Assert.Empty(t1.GetAttributes()); 96773Assert.Empty(t1.GetAttributes()); 96781Assert.Empty(t2.GetAttributes()); 96816Assert.Empty(t1.GetAttributes()); 96823Assert.Empty(t2.GetAttributes()); 96861Assert.Empty(t1.GetAttributes()); 96868Assert.Empty(t2.GetAttributes()); 96944Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", af1.GetAttributes().Single().ToString()); 96953Assert.Empty(at1.GetAttributes()); 96958Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(0)", at1.GetAttributes().Single().ToString()); 96974Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 96982Assert.Empty(tf1.GetAttributes()); 96987var attributes = tf1.GetAttributes(); 97039Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", af1.GetAttributes().Single().ToString()); 97048Assert.Empty(at1.GetAttributes()); 97053Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(0)", at1.GetAttributes().Single().ToString()); 97067Assert.Empty(bf1.GetAttributes()); 97075Assert.Empty(tf1.GetAttributes()); 97080Assert.Empty(tf1.GetAttributes()); 98202Assert.Empty(tf1.GetAttributes()); 98226Assert.Empty(tf1.GetAttributes()); 98254Assert.Empty(tf1.GetAttributes()); 98281Assert.Empty(tf1.GetAttributes()); 98308Assert.Empty(tf1.GetAttributes()); 98335Assert.Empty(tf1.GetAttributes()); 98362Assert.Empty(tf1.GetAttributes()); 98393Assert.Empty(i1.GetAttributes()); 98397Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 98404Assert.Empty(tf1.GetAttributes()); 98435Assert.Empty(tf1.GetAttributes()); 98462Assert.Empty(i1.GetAttributes()); 98466Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 98473Assert.Empty(tf1.GetAttributes()); 98496Assert.Empty(i1.GetAttributes()); 98500Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 98508Assert.Empty(tf1.GetAttributes()); 98536Assert.Empty(i1.GetAttributes()); 98540Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 98547Assert.Empty(tf1.GetAttributes()); 98574Assert.Empty(i1.GetAttributes()); 98578Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", i1.GetAttributes().Single().ToString()); 98585Assert.Empty(tf1.GetAttributes()); 98612var attributes = tf1.GetAttributes(); 98640var attributes = tf1.GetAttributes(); 98668var attributes = tf1.GetAttributes(); 98696Assert.Empty(i1.GetAttributes()); 98700Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 98707var attributes = tf1.GetAttributes(); 98735var attributes = tf1.GetAttributes(); 98762Assert.Empty(tf1.GetAttributes()); 98785Assert.Empty(tf1.GetAttributes()); 98812Assert.Empty(tf1.GetAttributes()); 98838Assert.Empty(tf1.GetAttributes()); 98864Assert.Empty(tf1.GetAttributes()); 98890Assert.Empty(tf1.GetAttributes()); 98916Assert.Empty(tf1.GetAttributes()); 98947Assert.Empty(i1.GetAttributes()); 98951Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 98956var attributes = tf1.GetAttributes(); 98987Assert.Empty(tf1.GetAttributes()); 99014Assert.Empty(i1.GetAttributes()); 99018Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 99023var attributes = tf1.GetAttributes(); 99047Assert.Empty(i1.GetAttributes()); 99051Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 99057var attributes = tf1.GetAttributes(); 99086Assert.Empty(i1.GetAttributes()); 99090Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 99095var attributes = tf1.GetAttributes(); 99123Assert.Empty(i1.GetAttributes()); 99127Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", i1.GetAttributes().Single().ToString()); 99132var attributes = tf1.GetAttributes(); 99159var attributes = tf1.GetAttributes(); 99186var attributes = tf1.GetAttributes(); 99213var attributes = tf1.GetAttributes(); 99241Assert.Empty(i1.GetAttributes()); 99245Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 99250var attributes = tf1.GetAttributes(); 99277var attributes = tf1.GetAttributes(); 99309var attributes = tf1.GetAttributes(); 99341Assert.Empty(i1.GetAttributes()); 99345Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 99350var attributes = tf1.GetAttributes(); 99384Assert.Empty(i1.GetAttributes()); 99388Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 99393var attributes = tf1.GetAttributes(); 99428Assert.Empty(i1.GetAttributes()); 99432Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 99437var attributes = tf1.GetAttributes(); 101086Assert.Empty(t11.GetAttributes()); 101090Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(1)", t11.GetAttributes().Single().ToString()); 101099Assert.Empty(t1.GetAttributes()); 101103Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(1)", t1.GetAttributes().Single().ToString()); 101113Assert.Empty(t22.GetAttributes()); 101117Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t22.GetAttributes().Single().ToString()); 101127Assert.Empty(t2.GetAttributes()); 101131Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t2.GetAttributes().Single().ToString()); 101178Assert.Empty(b.GetAttributes()); 101182Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", b.GetAttributes().First().ToString()); 101188Assert.Empty(t11.GetAttributes()); 101197Assert.Empty(t22.GetAttributes()); 101201CSharpAttributeData nullableAttribute = t22.GetAttributes().Single(); 101255Assert.Empty(b.GetAttributes()); 101259Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", b.GetAttributes().First().ToString()); 101265Assert.Empty(t11.GetAttributes()); 101274Assert.Empty(t22.GetAttributes()); 101278CSharpAttributeData nullableAttribute = t22.GetAttributes().Single(); 104549Assert.Empty(tm1.GetAttributes()); 120191Assert.Empty(f.GetAttributes()); 120195Assert.Equal(baseline[i].attribute, f.GetAttributes().Single().ToString()); 120469Assert.Equal(typeParametersBaseline[i].attribute, t.GetAttributes().Single().ToString());
Semantics\PrimaryConstructorTests.cs (9)
2939return GetAttributeStrings(symbol.GetAttributes()); 2994Assert.Empty(comp.GetTypeByMetadataName("Test1").InstanceConstructors.Where(c => !c.IsDefaultValueTypeConstructor()).Single().Parameters[0].GetAttributes()); 2995Assert.Equal(2, comp.GetTypeByMetadataName("Test2").InstanceConstructors.Where(c => !c.IsDefaultValueTypeConstructor()).Single().Parameters[0].GetAttributes().Count()); 3037Assert.Empty(comp.GetTypeByMetadataName("Test1").InstanceConstructors.Where(c => !c.IsDefaultValueTypeConstructor()).Single().Parameters[0].GetAttributes()); 3038Assert.Equal(1, comp.GetTypeByMetadataName("Test2").InstanceConstructors.Where(c => !c.IsDefaultValueTypeConstructor()).Single().Parameters[0].GetAttributes().Count()); 14698var attr = m.GlobalNamespace.GetTypeMember("C1").GetMembers().OfType<FieldSymbol>().Single().GetAttributes(); 14720var attr = m.GlobalNamespace.GetTypeMember("C1").GetMembers().OfType<FieldSymbol>().Single().GetAttributes(); 14741var attr = m.GlobalNamespace.GetTypeMember("C1").GetMembers().OfType<FieldSymbol>().Single().GetAttributes(); 14762var attr = m.GlobalNamespace.GetTypeMember("C1").GetMembers().OfType<FieldSymbol>().Single().GetAttributes();
Semantics\RawInterpolationTests_Handler.cs (42)
3226Assert.Equal("Attr..ctor(CustomHandler c)", attr.GetAttributes().Single().AttributeConstructor.ToTestDisplayString()); 3251Assert.Equal("Attr..ctor(System.String s)", attr.GetAttributes().Single().AttributeConstructor.ToTestDisplayString()); 5078sParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5106sParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5143cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5183cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5230cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5270cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5317cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5360cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5407cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5447cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5494cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5534cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5581cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5628cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5675cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5715cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5764cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5804cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5853cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5899cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5946cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5976cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6102cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6171cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6201cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6438cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6500cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6622cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6854cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6981cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7134cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7247cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7318cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7378cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7496cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7614cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7742cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8015cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8094cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8521cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString());
Semantics\RecordStructTests.cs (1)
10522return GetAttributeStrings(symbol.GetAttributes().Where(a => a.AttributeClass!.Name is "A" or "B" or "C" or "D"));
Semantics\RecordTests.cs (7)
25117return GetAttributeStrings(symbol.GetAttributes().Where(a => a.AttributeClass!.Name is "A" or "B" or "C" or "D")); 25177return GetAttributeStrings(symbol.GetAttributes().Where(a => 25254return GetAttributeStrings(symbol.GetAttributes().Where(a => 25315return GetAttributeStrings(symbol.GetAttributes().Where(a => 25396return GetAttributeStrings(symbol.GetAttributes().Where(a => 25480return GetAttributeStrings(symbol.GetAttributes().Where(a => 25544return GetAttributeStrings(symbol.GetAttributes().Where(a =>
Semantics\RefFieldTests.cs (1)
11506var attribute = parameter.GetAttributes().FirstOrDefault(a => a.GetTargetAttributeSignatureIndex(parameter, AttributeDescription.ScopedRefAttribute) != -1);
Semantics\TopLevelStatementsTests.cs (9)
6159var programAttributes = GetAttributeNames(program.GetAttributes().As<CSharpAttributeData>()); 6171Assert.Empty(method.GetAttributes()); 6177Assert.Equal(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(localFn1.GetAttributes().As<CSharpAttributeData>())); 9055Assert.Empty(program.GetAttributes().As<CSharpAttributeData>()); 9059Assert.Equal(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(program.GetAttributes().As<CSharpAttributeData>())); 9061Assert.Empty(program.GetMethod(WellKnownMemberNames.TopLevelStatementsEntryPointMethodName).GetAttributes()); 9106Assert.Empty(program.GetAttributes().As<CSharpAttributeData>()); 9108Assert.Empty(program.GetMethod(WellKnownMemberNames.TopLevelStatementsEntryPointMethodName).GetAttributes().As<CSharpAttributeData>()); 9493var fieldAttributes = GetAttributeNames(field.GetAttributes().As<CSharpAttributeData>());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (131)
Symbols\AnonymousTypesSymbolTests.cs (1)
1147var actual = symbol.GetAttributes();
Symbols\DefaultInterfaceImplementationTests.cs (12)
10908Assert.Equal(2, m2.GetAttributes().Length); 10909Assert.Equal("Test2(1)", m2.GetAttributes()[0].ToString()); 10910Assert.Equal("Test2(2)", m2.GetAttributes()[1].ToString()); 10926Assert.Equal(2, m2Impl.GetAttributes().Length); 10927Assert.Equal("Test2(1)", m2Impl.GetAttributes()[0].ToString()); 10928Assert.Equal("Test2(2)", m2Impl.GetAttributes()[1].ToString()); 11015Assert.Equal(2, m2.GetAttributes().Length); 11016Assert.Equal("Test2(1)", m2.GetAttributes()[0].ToString()); 11017Assert.Equal("Test2(2)", m2.GetAttributes()[1].ToString()); 11033Assert.Equal(2, m2Impl.GetAttributes().Length); 11034Assert.Equal("Test2(1)", m2Impl.GetAttributes()[0].ToString()); 11035Assert.Equal("Test2(2)", m2Impl.GetAttributes()[1].ToString());
Symbols\ImplicitClassTests.cs (2)
32Assert.Equal(0, implicitClass.GetAttributes().Length); 61Assert.Equal(0, scriptClass.GetAttributes().Length);
Symbols\IndexerTests.cs (1)
2130Assert.True(indexer.GetAttributes().Single().IsTargetAttribute(indexer, AttributeDescription.IndexerNameAttribute));
Symbols\Metadata\PE\LoadingAttributes.cs (71)
205c1.GetAttributes().First().VerifyValue(0, TypedConstantKind.Primitive, "C1"); 208innerC1.GetAttributes().First().VerifyValue(0, TypedConstantKind.Primitive, "InnerC1"); 215innerC2.GetAttributes().First().VerifyValue(0, TypedConstantKind.Primitive, "InnerC2"); 218field1.GetAttributes().First().VerifyValue(0, TypedConstantKind.Primitive, "field1"); 221property1.GetAttributes().First().VerifyValue(0, TypedConstantKind.Primitive, "Property1"); 224sub1.GetAttributes().First().VerifyValue(0, TypedConstantKind.Primitive, "Sub1"); 227sub1P1.GetAttributes().First().VerifyValue(0, TypedConstantKind.Primitive, "p1"); 230function1.GetAttributes().First().VerifyValue(0, TypedConstantKind.Primitive, "Function1"); 385c1.GetAttributes().First().VerifyValue(0, TypedConstantKind.Primitive, "C1"); 432l.GetAttributes().First().VerifyValue(0, TypedConstantKind.Type, "System.Collections.Generic.List<>"); 435l.GetAttributes().First().VerifyValue(0, TypedConstantKind.Type, "System.Collections.Generic.List<C1>"); 438l.GetAttributes().First().VerifyValue(0, TypedConstantKind.Type, "System.Collections.Generic.List<System.String>"); 441l.GetAttributes().First().VerifyValue(0, TypedConstantKind.Type, "System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<C1, System.String>>"); 444l.GetAttributes().First().VerifyValue(0, TypedConstantKind.Type, "System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String, C1.InnerC1<System.Int32>.InnerC2<System.String, System.String>>>"); 476var arg = field.GetAttributes().Single(); 480arg = field.GetAttributes().Single(); 484arg = field.GetAttributes().Single(); 488arg = field.GetAttributes().Single(); 492arg = field.GetAttributes().Single(); 496var t = field.GetAttributes().First().CommonConstructorArguments.Single().Type; 498arg = field.GetAttributes().Single(); 502arg = field.GetAttributes().Single(); 508arg = field.GetAttributes().Single(); 546foreach (var sa in s.GetAttributes()) 598var attrs = asm.GetAttributes(); 688Assert.Equal(4, igoo.GetAttributes().Length); 711Assert.Equal(1, mem.GetAttributes().Length); 713Assert.Equal(1, mem.GetAttributes().Length); 715Assert.Equal(1, mem.GetAttributes().Length); 717attrSym = mem.GetAttributes().First(); 742Assert.Equal(2, dfoo.GetAttributes().Length); 781var modattr = assemblies[0].Modules[0].GetAttributes().First(); 787Assert.Equal(2, myEnum.GetAttributes().Length); 791Assert.Equal(0, field.GetAttributes().Length); 794Assert.Equal(1, field.GetAttributes().Length); 795var attrSym = field.GetAttributes().First(); 848Assert.Equal(5, ibar.GetAttributes().Length); 849var atts = ibar.GetAttributes(); 863mem.GetAttributes().First().VerifyValue(0, TypedConstantKind.Primitive, 10); 871Assert.Equal(1, mem2.GetAttributes().Length); 875Assert.Equal(1, mem2.GetAttributes().Length); 894Assert.Equal(1, mem2.GetAttributes().Length); 895attrSym = mem2.GetAttributes().First(); 920Assert.Equal(4, assemblies[0].GetAttributes().Length); 929attrSym = assemblies[0].Modules[0].GetAttributes().First(); 964var attrSym = tp.GetAttributes().First(); 985Assert.Equal(1, mtd.GetAttributes().Length); 986attrSym = mtd.GetAttributes().First(); 1060var attrs = (from a in foo.GetAttributes() 1064Assert.Equal(foo.GetAttributes().Length, attrs.Count()); 1109Assert.Equal(2, tp.GetAttributes().Length); 1113Assert.Equal(2, fld.GetAttributes().Length); 1114Assert.Equal(0, fld.GetAttributes().First().CommonNamedArguments.Length); 1118Assert.Equal(1, prop.GetAttributes().Length); 1119Assert.Equal(-1, prop.GetAttributes().First().CommonConstructorArguments[0].Value); 1121Assert.Equal(3, prop.GetMethod.GetAttributes().Length); 1122Assert.Equal(1, prop.SetMethod.GetAttributes().Length); 1128Assert.Equal(3, mtd.GetAttributes().Length); 1130attrs = (from a in mtd.GetAttributes() 1141attrs = (from a in mtd.GetAttributes() 1241var attr = prop.GetAttributes().First(); 1433Assert.Empty(field1.GetAttributes()); 1438Assert.Equal(2, field2.GetAttributes().Length); 1444Assert.Empty(parameters.First().GetAttributes()); 1447Assert.Empty(parameters.Last().GetAttributes()); 1461Assert.Empty(field1.GetAttributes()); 1466Assert.Equal(2, field2.GetAttributes().Length); 1472Assert.Empty(parameters.First().GetAttributes()); 1475Assert.Empty(parameters.Last().GetAttributes()); 1514Assert.Equal(expected, c.GetTypeByMetadataName("Test").GetAttributes().Single().ToString()); 1518Assert.Equal(expected, m.GlobalNamespace.GetTypeMember("Test").GetAttributes().Single().ToString());
Symbols\Metadata\PE\LoadingNamespacesAndTypes.cs (1)
260Assert.Equal(0, collections.GetAttributes().Length);
Symbols\RequiredMembersTests.cs (18)
59Assert.All(member.GetAttributes(), attr => AssertEx.NotEqual("System.Runtime.CompilerServices.RequiredMemberAttribute", attr.AttributeClass.ToTestDisplayString())); 88var ctorAttributes = ctor.GetAttributes(); 3323var attr = c.GetAttributes().Single(); 3352var attr = attrAttribute.GetAttributes().Where(a => a.AttributeClass!.Name == "AttrAttribute").Single(); 3382var attr = p.GetAttributes().Where(a => a.AttributeClass!.Name == "AttrAttribute").Single(); 3412var attr = f.GetAttributes().Where(a => a.AttributeClass!.Name == "AttrAttribute").Single(); 5215Assert.Empty(copyCtor.GetAttributes()); 5220copyCtor.GetAttributes().Single(a => a.AttributeClass!.IsWellKnownSetsRequiredMembersAttribute()).AttributeConstructor.ToTestDisplayString()); 5277Assert.Empty(copyCtor.GetAttributes()); 5282copyCtor.GetAttributes().Single(a => a.AttributeClass!.IsWellKnownSetsRequiredMembersAttribute()).AttributeConstructor.ToTestDisplayString()); 5440var attrData = ctor.GetAttributes().Single(); 5486var attrData = ctor.GetAttributes().Single(); 5734Assert.Empty(c.GetAttributes()); 5735Assert.Empty(field1.GetAttributes()); 5736Assert.Empty(property1.GetAttributes()); 5737Assert.Empty(d.GetAttributes()); 5738Assert.Empty(field2.GetAttributes()); 5739Assert.Empty(property2.GetAttributes());
Symbols\Retargeting\NoPia.cs (18)
2056var args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2071args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2086args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2101args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2181var args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2196args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2211args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2226args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2306var args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2321args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2336args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2351args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2418var args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2433args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2514var args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2529args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2544args = attrTest1.GetAttributes()[0].CommonConstructorArguments; 2559args = attrTest1.GetAttributes()[0].CommonConstructorArguments;
Symbols\Retargeting\RetargetCustomAttributes.cs (4)
103TestAttributeRetargeting(symbol.GetAttributes()); 303var attr = c.GetAttributes().Single(); 349var a = c1.GetAttributes().Single(); 391var a = c1.GetAttributes().Single();
Symbols\TypeTests.cs (3)
500Assert.Equal(0, retType.GetAttributes().Length); // Enumerable.Empty<SymbolAttribute>() 1879i1.GetAttributes(); 1931i1.GetAttributes();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (12)
Extensions.cs (7)
329return @this.GetAttributes().Where(a => TypeSymbol.Equals(a.AttributeClass, c, TypeCompareKind.ConsiderEverything2)); 334return @this.GetAttributes().Where(a => a.IsTargetAttribute(namespaceName, typeName)); 339return @this.GetAttributes().Where(a => a.IsTargetAttribute(@this, description)); 344return @this.GetAttributes().Where(a => TypeSymbol.Equals(a.AttributeClass, c, TypeCompareKind.ConsiderEverything2)).First(); 349return @this.GetAttributes().Where(a => a.IsTargetAttribute(namespaceName, typeName)).First(); 354return (from a in @this.GetAttributes() 361return (from a in @this.GetAttributes()
NullableAttributesVisitor.cs (4)
37_nullableContext = GetNullableContextAttribute(type.GetAttributes()) ?? _nullableContext; 47_nullableContext = GetNullableContextAttribute(method.GetAttributes()) ?? _nullableContext; 63var nullableContextAttribute = GetNullableContextAttribute(symbol.GetAttributes()); 64var nullableAttribute = GetNullableAttribute((symbol is MethodSymbol method) ? method.GetReturnTypeAttributes() : symbol.GetAttributes());
TestAttributesVisitor.cs (1)
141var attribute = GetTargetAttribute((symbol is MethodSymbol method) ? method.GetReturnTypeAttributes() : symbol.GetAttributes());
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
Metadata\WinMdDumpTest.cs (2)
44if (container.GetAttributes().Length > 0) 221var attributes = symbol.GetAttributes();