2010-05-19 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / gtest-239.cs
blob6add5879654e47895a7399060ec3239c8ba65365
1 using System;
3 class Foo<T,U>
5 public int Test (T t, U u)
7 return 1;
10 public int Test (int t, U u)
12 return 2;
15 public int Test (T t, float u)
17 return 3;
20 public int Test (int t, float u)
22 return 4;
26 class X
28 static int Main ()
30 Foo<long,float> a = new Foo<long,float> ();
31 if (a.Test (3L, 3.14F) != 3)
32 return 1;
33 if (a.Test (3L, 8) != 3)
34 return 2;
35 if (a.Test (3, 3.14F) != 4)
36 return 3;
37 if (a.Test (3, 8) != 4)
38 return 4;
40 Foo<long,double> b = new Foo<long,double> ();
41 if (b.Test (3L, 3.14F) != 3)
42 return 5;
43 if (b.Test (3, 3.14F) != 4)
44 return 6;
45 if (b.Test (3L, 3.14F) != 3)
46 return 7;
47 if (b.Test (3L, 5) != 3)
48 return 8;
50 Foo<string,float> c = new Foo<string,float> ();
51 if (c.Test ("Hello", 3.14F) != 3)
52 return 9;
54 Foo<int,string> d = new Foo<int,string> ();
55 if (d.Test (3, "Hello") != 2)
56 return 10;
58 return 0;