2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / tests / test-134.cs
1 //
2 // This test checks if we implement all the interfaces inherited
3 //
4
5 interface IA {
6         void A ();
7 }
8
9 interface IB : IA {
10         void B ();
11 }
12
13 interface IC : IA, IB {
14         void C ();
15 }
16
17 interface ID : IC {
18 }
19
20 class AA : IC {
21         bool a, b, c;
22         public void A () { a = true; }
23         public void B () { b = true; }
24         public void C () { c = true; }
25
26         public bool OK {
27                 get {
28                         return a && b && c;
29                 }
30         }
31 }
32
33 class BB : ID{
34         bool a, b, c;
35         public void A () { a = true; System.Console.WriteLine ("A"); }
36         public void B () { b = true; }
37         public void C () { c = true; }
38
39         public bool OK {
40                 get {
41                         return a && b && c;
42                 }
43         }
44 }
45
46 class T: IB {
47         public void A () {}
48         public void B () {}
49
50         static int Main() {
51
52                 BB bb = new BB ();
53                 bb.A ();
54                 bb.B ();
55                 bb.C ();
56
57                 if (!bb.OK)
58                         return 1;
59
60                 AA aa = new AA ();
61                 aa.A ();
62                 aa.B ();
63                 aa.C ();
64                 if (!aa.OK)
65                         return 2;
66
67                 return 0;
68         }
69 }