2010-06-17 Geoff Norton <gnorton@novell.com>
[mono.git] / mono / tests / bug-48015.cs
blobc5e7c303ae2728999b8ce2d7e7f13d57add86bc5
1 using System;
2 using System.Collections;
3 using System.Runtime.Remoting;
5 public class Foo : System.ContextBoundObject {
8 public class Bar : System.ContextBoundObject {
10 public void Test(Foo f) {
11 if (RemotingServices.IsTransparentProxy (f))
12 Console.WriteLine ("Bar::Test(Foo) Is TP");
13 else
14 Console.WriteLine ("Bar::Test(Foo) Is NOT a TP (error!)");
16 if (!f.Equals (f))
17 Console.WriteLine ("Bar::Test(Foo) f.Equals (b) failed (error!)");
18 else
19 Console.WriteLine ("Bar::Test(Foo) f.Equals (f) ok!");
23 public class Driver {
24 public static void Main (string[] args) {
25 Foo f = new Foo();
26 Bar b = new Bar();
28 if (!b.Equals (b))
29 Console.WriteLine ("b.Equals (b) failed (error!)");
30 else
31 Console.WriteLine ("b.Equals (b) ok!");
33 if (RemotingServices.IsTransparentProxy (b))
34 Console.WriteLine ("b is a TP");
35 else
36 Console.WriteLine ("b is NOT a TP (error!)");
38 b.Test(f);
40 if (!f.Equals (f))
41 Console.WriteLine ("f.Equals (b) failed (error!)");
42 else
43 Console.WriteLine ("f.Equals (f) ok!");
45 Console.WriteLine ("test end.");