diff options
Diffstat (limited to 'src/tests/reflection')
-rw-r--r-- | src/tests/reflection/GenericAttribute/GenericAttributeMetadata.cs | 2 | ||||
-rw-r--r-- | src/tests/reflection/GenericAttribute/GenericAttributeTests.cs | 14 |
2 files changed, 3 insertions, 13 deletions
diff --git a/src/tests/reflection/GenericAttribute/GenericAttributeMetadata.cs b/src/tests/reflection/GenericAttribute/GenericAttributeMetadata.cs index 3bea1e62194..d0ef6353f4a 100644 --- a/src/tests/reflection/GenericAttribute/GenericAttributeMetadata.cs +++ b/src/tests/reflection/GenericAttribute/GenericAttributeMetadata.cs @@ -17,8 +17,6 @@ using System.Runtime.CompilerServices; [assembly: MultiAttribute<bool>()] [assembly: MultiAttribute<bool>(true)] -[module: SingleAttribute<long>()] - [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = false)] public class SingleAttribute<T> : Attribute { diff --git a/src/tests/reflection/GenericAttribute/GenericAttributeTests.cs b/src/tests/reflection/GenericAttribute/GenericAttributeTests.cs index b1dcd6bbbe3..e7661d2d5ae 100644 --- a/src/tests/reflection/GenericAttribute/GenericAttributeTests.cs +++ b/src/tests/reflection/GenericAttribute/GenericAttributeTests.cs @@ -18,16 +18,8 @@ class Program Assert(((ICustomAttributeProvider)assembly).IsDefined(typeof(SingleAttribute<int>), true)); Assert(CustomAttributeExtensions.IsDefined(assembly, typeof(SingleAttribute<bool>))); Assert(((ICustomAttributeProvider)assembly).IsDefined(typeof(SingleAttribute<bool>), true)); - Assert(!CustomAttributeExtensions.GetCustomAttributes(assembly, typeof(SingleAttribute<>)).GetEnumerator().MoveNext()); - Assert(!CustomAttributeExtensions.GetCustomAttributes(assembly, typeof(SingleAttribute<>)).GetEnumerator().MoveNext()); -*/ - // Module module = programTypeInfo.Module; - // AssertAny(CustomAttributeExtensions.GetCustomAttributes(module), a => a is SingleAttribute<long>); - // Assert(CustomAttributeExtensions.GetCustomAttributes(module, typeof(SingleAttribute<long>)).GetEnumerator().MoveNext()); - // Assert(CustomAttributeExtensions.GetCustomAttributes(module, typeof(SingleAttribute<long>)).GetEnumerator().MoveNext()); - // Assert(!CustomAttributeExtensions.GetCustomAttributes(module, typeof(SingleAttribute<>)).GetEnumerator().MoveNext()); - // Assert(!CustomAttributeExtensions.GetCustomAttributes(module, typeof(SingleAttribute<>)).GetEnumerator().MoveNext()); +*/ TypeInfo programTypeInfo = typeof(Class).GetTypeInfo(); Assert(CustomAttributeExtensions.GetCustomAttribute<SingleAttribute<int>>(programTypeInfo) != null); @@ -160,8 +152,8 @@ class Program AssertAny(b10, a => (a as MultiAttribute<Type>)?.Value == typeof(Class)); AssertAny(b10, a => (a as MultiAttribute<Type>)?.Value == typeof(Class.Derive)); - Assert(!CustomAttributeExtensions.GetCustomAttributes(programTypeInfo, typeof(MultiAttribute<>), false).GetEnumerator().MoveNext()); - Assert(!CustomAttributeExtensions.GetCustomAttributes(programTypeInfo, typeof(MultiAttribute<>), true).GetEnumerator().MoveNext()); + Assert(CustomAttributeExtensions.GetCustomAttributes(programTypeInfo, typeof(MultiAttribute<>), false) == null); + Assert(CustomAttributeExtensions.GetCustomAttributes(programTypeInfo, typeof(MultiAttribute<>), true) == null); Assert(!((ICustomAttributeProvider)programTypeInfo).GetCustomAttributes(typeof(MultiAttribute<>), true).GetEnumerator().MoveNext()); // Test coverage for CustomAttributeData api surface |