aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/csharp/director_default_runme.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/csharp/director_default_runme.cs')
-rw-r--r--Examples/test-suite/csharp/director_default_runme.cs58
1 files changed, 58 insertions, 0 deletions
diff --git a/Examples/test-suite/csharp/director_default_runme.cs b/Examples/test-suite/csharp/director_default_runme.cs
new file mode 100644
index 000000000..af14c1eb4
--- /dev/null
+++ b/Examples/test-suite/csharp/director_default_runme.cs
@@ -0,0 +1,58 @@
+using System;
+
+namespace director_defaultNamespace {
+
+public class runme
+{
+ static void Main()
+ {
+ {
+ MyFoo a = new MyFoo();
+ a = new MyFoo(10);
+ a.Dispose();
+ }
+
+ {
+ MyFoo a = new MyFoo();
+ if (a.GetMsg() != "MyFoo-default") {
+ throw new Exception( "Test 1 failed" );
+ }
+ if (a.GetMsg("boo") != "MyFoo-boo") {
+ throw new Exception( "Test 2 failed" );
+ }
+ a.Dispose();
+ }
+
+ {
+ Foo b = new Foo();
+ if (b.GetMsg() != "Foo-default") {
+ throw new Exception( "Test 1 failed" );
+ }
+ if (b.GetMsg("boo") != "Foo-boo") {
+ throw new Exception( "Test 2 failed" );
+ }
+ b.Dispose();
+ }
+ }
+}
+
+public class MyFoo : Foo
+{
+ public MyFoo()
+ : base()
+ {
+ }
+
+ public MyFoo(int i)
+ : base(i)
+ {
+ }
+
+ public override string Msg(string msg)
+ {
+ return "MyFoo-" + msg;
+ }
+}
+
+}
+