Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / bug-544446.cs
1 using System;
2 using System.Runtime.Remoting;
3 using System.Runtime.Remoting.Messaging;
4 using System.Runtime.Remoting.Proxies;
5 using System.Collections.Generic;
6
7 class MyProxy : RealProxy {
8         readonly MarshalByRefObject target;
9
10         public MyProxy (MarshalByRefObject target) : base (target.GetType())
11         {
12                 this.target = target;
13         }
14
15         public override IMessage Invoke (IMessage request) {
16                 IMethodCallMessage call = (IMethodCallMessage)request;
17                 return RemotingServices.ExecuteMessage (target, call);
18         }
19 }
20
21 class R1 : MarshalByRefObject {
22
23         public void foo (out  Dictionary<string, int> paramAssignmentStatus) {
24
25                 paramAssignmentStatus = new Dictionary<string, int> ();
26                 paramAssignmentStatus.Add ("One", 1);
27         }
28 }
29
30 class Test {
31         static int Main () {
32                 MyProxy real_proxy = new MyProxy (new R1 ());
33                 R1 o = (R1)real_proxy.GetTransparentProxy ();
34
35                 Dictionary<string, int> i;
36                 o.foo (out i);
37                 if (1 == i["One"])
38                         return 0;
39                 return 1;
40         }
41 }