Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@gnome.org>2002-10-23 03:59:33 +0400
committerMiguel de Icaza <miguel@gnome.org>2002-10-23 03:59:33 +0400
commit41fd8089b6127a4ad7d6dccb2748a78f7d860240 (patch)
tree8dcf90219ae3ec17e4d6339fb9d62b3f5253d1b6 /mcs/tests/test-169.cs
parent7e514160809ad0c5e18569441641087feffc9f05 (diff)
Add new test
svn path=/trunk/mcs/; revision=8483
Diffstat (limited to 'mcs/tests/test-169.cs')
-rw-r--r--mcs/tests/test-169.cs65
1 files changed, 65 insertions, 0 deletions
diff --git a/mcs/tests/test-169.cs b/mcs/tests/test-169.cs
new file mode 100644
index 00000000000..703c3148085
--- /dev/null
+++ b/mcs/tests/test-169.cs
@@ -0,0 +1,65 @@
+//
+// Test for overloaded properties.
+//
+using System;
+
+public class basec {
+ public virtual string Message {
+ get {
+ return "base";
+ }
+ }
+}
+
+public class der : basec {
+ public override string Message {
+ get {
+ return "der";
+ }
+ }
+}
+
+class Base {
+ int thingy = 0;
+ public virtual int Thingy {
+ get { return thingy; }
+ set { thingy = value; }
+ }
+}
+
+class Derived : Base {
+ public int BaseThingy {
+ get { return Thingy; }
+ }
+
+ public override int Thingy {
+ // override the set constructor
+ set { }
+ }
+}
+
+class D {
+
+ static int Main ()
+ {
+ //
+ // These tests just are compilation tests, the new property code
+ // will excercise these
+ //
+ der d = new der ();
+ if (d.Message != "der")
+ return 1;
+
+ basec b = new basec ();
+ if (b.Message != "base")
+ return 2;
+
+ Derived dd = new Derived ();
+ dd.Thingy = 10;
+ if (dd.BaseThingy != 0)
+ return 3;
+
+ Console.WriteLine ("Test ok");
+ return 0;
+ }
+}