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

gtest-128.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 465ed95ceb01357407b3f4927d8a1355762d9c04 (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;

namespace FLMID.Bugs.ParametersOne
{
	public class Class<T>
	{
		public void Add(T x)
		{
			System.Console.WriteLine("OK");
		}
	}
	public class Test
	{
	
		public static void Main(string [] args)
		{
			Class<string> instance = new Class<string>();
			
			MethodInfo _method = null;
			
			foreach(MethodInfo method in
typeof(Class<string>).GetMethods(BindingFlags.Instance | BindingFlags.Public))
			{
				if(method.Name.Equals("Add") && method.GetParameters().Length==1)
				{
					_method = method;
					break;
				}
			}
			_method.Invoke(instance , new object[]{"1"});
		}
	}
}