* roottypes.cs: Rename from tree.cs.
[mono.git] / mono / tests / bug-48015.cs
1 using System;
2 using System.Collections;
3 using System.Runtime.Remoting;
4
5 public class Foo : System.ContextBoundObject {
6 }
7
8 public class Bar : System.ContextBoundObject {
9
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!)");
15
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!");
20         }
21 }
22
23 public class Driver {
24   public static void Main (string[] args) {
25     Foo f = new Foo();
26         Bar b = new Bar();
27     
28     if (!b.Equals (b))
29         Console.WriteLine ("b.Equals (b) failed (error!)");
30     else
31         Console.WriteLine ("b.Equals (b) ok!");
32
33     if (RemotingServices.IsTransparentProxy (b))
34                 Console.WriteLine ("b is a TP");
35         else
36                 Console.WriteLine ("b is NOT a TP (error!)");
37
38         b.Test(f);
39
40         if (!f.Equals (f))
41                 Console.WriteLine ("f.Equals (b) failed (error!)");
42         else
43                 Console.WriteLine ("f.Equals (f) ok!");
44
45         Console.WriteLine ("test end.");
46   }
47 }
48