Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gtest-286.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5f47cf4603b6ab45d4eb840cec46cc6413027b7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.Reflection;

public class TestAttribute : Attribute
{
    public Type type;

    public TestAttribute(Type type)
    {
        this.type = type;
    }
}

class C<T>
{
    [Test(typeof(C<string>))]
    public static void Foo()
    {
    }
}

public class C
{
	public static int Main ()
	{
		MethodInfo mi = typeof (C<>).GetMethod ("Foo");
		object[] a = mi.GetCustomAttributes (false);
		if (((TestAttribute)a[0]).type.ToString() != "C`1[System.String]")
			return 1;

		Console.WriteLine("OK");
		return 0;
	}
}