New test.
[mono.git] / mcs / tests / gtest-286.cs
1 using System;\r
2 using System.Reflection;\r
3 \r
4 public class TestAttribute : Attribute\r
5 {\r
6     public Type type;\r
7 \r
8     public TestAttribute(Type type)\r
9     {\r
10         this.type = type;\r
11     }\r
12 }\r
13 \r
14 class C<T>\r
15 {\r
16     [Test(typeof(C<string>))]\r
17     public static void Foo()\r
18     {\r
19     }\r
20 }\r
21 \r
22 public class C\r
23 {\r
24         public static int Main ()\r
25         {\r
26                 MethodInfo mi = typeof (C<>).GetMethod ("Foo");\r
27                 object[] a = mi.GetCustomAttributes (false);\r
28                 if (((TestAttribute)a[0]).type.ToString() != "C`1[System.String]")\r
29                         return 1;\r
30 \r
31                 Console.WriteLine("OK");\r
32                 return 0;\r
33         }\r
34 }