2004-08-03 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / tests / 2test-12.cs
1 public partial class Test
2 {
3         public readonly Foo TheFoo;
4
5         public Test ()
6         {
7                 this.TheFoo = new Foo ();
8         }
9
10         public partial interface IFoo
11         {
12                 int Hello (Test foo);
13         }
14
15         public int TestFoo ()
16         {
17                 return TheFoo.Hello (this);
18         }
19 }
20
21 public partial class Test
22 {
23         public partial class Foo : IFoo
24         {
25                 int IFoo.Hello (Test test)
26                 {
27                         return 2;
28                 }
29
30                 public int Hello (Test test)
31                 {
32                         return 1;
33                 }
34         }
35
36         public int TestIFoo (IFoo foo)
37         {
38                 return foo.Hello (this);
39         }
40 }
41
42 class X
43 {
44         static int Main ()
45         {
46                 Test test = new Test ();
47                 if (test.TestFoo () != 1)
48                         return 1;
49                 if (test.TestIFoo (test.TheFoo) != 2)
50                         return 2;
51                 return 0;
52         }
53 }