do not check order sequence if option /order was not used
[mono.git] / mcs / tests / test-169.cs
1 //
2 // Test for overloaded properties.
3 //
4 using System;
5
6 public class basec {
7         public virtual string Message {
8                 get {
9                         return "base";
10                 }
11         }
12 }
13
14 public class der : basec {
15         public override string Message {
16                 get {
17                         return "der";
18                 }
19         }
20 }
21
22 class Base {
23         int thingy = 0;
24         public virtual int Thingy {
25                 get { return thingy; }
26                 set { thingy = value; }
27         }
28 }
29
30 class Derived : Base {
31         public int BaseThingy {
32                 get { return Thingy; }
33         }
34
35         public override int Thingy {
36                 // override the set constructor
37                 set { }
38         }
39 }
40
41 class D {
42
43         static int Main ()
44         {
45                 //
46                 // These tests just are compilation tests, the new property code
47                 // will excercise these
48                 //
49                 der d = new der ();
50                 if (d.Message != "der")
51                         return 1;
52
53                 basec b = new basec ();
54                 if (b.Message != "base")
55                         return 2;
56
57                 Derived dd = new Derived ();
58                 dd.Thingy = 10;
59                 if (dd.BaseThingy != 0)
60                         return 3;
61
62                 Console.WriteLine ("Test ok");
63                 return 0;
64         }
65 }