Пример #1
0
        private static ITestIntfPrx TestProxy(ITestIntfPrx prx)
        {
            var ctx = new Dictionary <string, string>(prx.Context);

            ctx.Add("MyCtx", "hello");

            TestHelper.Assert(prx.Op(13, ctx) == 13);
            prx.OpVoid(ctx);

            (int v, string s) = prx.OpReturnOut(34);
            TestHelper.Assert(v == 34 && s == "value=34");

            prx.OpOneway(42);

            try
            {
                prx.OpMyError();
                TestHelper.Assert(false);
            }
            catch (MyError ex)
            {
                TestHelper.Assert(ex.Number == 42);
            }

            try
            {
                prx.OpObjectNotExistException();
                TestHelper.Assert(false);
            }
            catch (ObjectNotExistException)
            {
            }

            return(prx.OpNewProxy().Clone(context: new Dictionary <string, string> {
                { "Direct", "1" }
            }));
        }