[corlib] Fix a few NSLogWriter issues. (#13799)
[mono-project.git] / mcs / tests / test-169.cs
blob2051287e49570098ba23ab34c1256a62865f5bf1
1 //
2 // Test for overloaded properties.
3 //
4 using System;
6 public class basec {
7 public virtual string Message {
8 get {
9 return "base";
14 public class der : basec {
15 public override string Message {
16 get {
17 return "der";
22 class Base {
23 int thingy = 0;
24 public virtual int Thingy {
25 get { return thingy; }
26 set { thingy = value; }
30 class Derived : Base {
31 public int BaseThingy {
32 get { return Thingy; }
35 public override int Thingy {
36 // override the set constructor
37 set { }
41 class D {
43 public static int Main ()
46 // These tests just are compilation tests, the new property code
47 // will excercise these
49 der d = new der ();
50 if (d.Message != "der")
51 return 1;
53 basec b = new basec ();
54 if (b.Message != "base")
55 return 2;
57 Derived dd = new Derived ();
58 dd.Thingy = 10;
59 if (dd.BaseThingy != 0)
60 return 3;
62 Console.WriteLine ("Test ok");
63 return 0;