2010-05-19 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / test-253.cs
blobd4f0096b9ba5a9ca33b50649e613b9b249d55156
1 using System;
2 using System.Reflection;
4 [AttributeUsage(AttributeTargets.Field)]
5 public class AccessibleAttribute:Attribute {}
7 public class MyClass
8 {
9 [Accessible]
10 public const int MyConst = 1;
14 public class Test
16 public static int Main()
18 FieldInfo fieldInfo = typeof(MyClass).GetField("MyConst",
19 BindingFlags.Static | BindingFlags.Public);
21 AccessibleAttribute[] attributes =
22 fieldInfo.GetCustomAttributes(
23 typeof(AccessibleAttribute), true) as AccessibleAttribute[];
25 if (attributes != null)
27 Console.WriteLine ("Succeeded");
28 return 0;
30 return 1;