Ejemplo n.º 1
0
        public async Task ProgressiveCallsCalleeProxyObservableError()
        {
            WampPlayground playground = new WampPlayground();

            CallerCallee dualChannel = await playground.GetCallerCalleeDualChannel();

            IWampChannel calleeChannel = dualChannel.CalleeChannel;
            IWampChannel callerChannel = dualChannel.CallerChannel;

            MyOperation myOperation = new MyOperation();

            await calleeChannel.RealmProxy.RpcCatalog.Register(myOperation, new RegisterOptions());

            ILongOpObsService proxy = callerChannel.RealmProxy.Services.GetCalleeProxy <ILongOpObsService>();

            Assert.Throws(typeof(WampException), () => proxy.LongOp(9, true).ToEnumerable().Count());
        }
Ejemplo n.º 2
0
        public async Task ProgressiveCallsCalleeProxyObservable()
        {
            WampPlayground playground = new WampPlayground();

            CallerCallee dualChannel = await playground.GetCallerCalleeDualChannel();

            IWampChannel calleeChannel = dualChannel.CalleeChannel;
            IWampChannel callerChannel = dualChannel.CallerChannel;

            MyOperation myOperation = new MyOperation();

            await calleeChannel.RealmProxy.RpcCatalog.Register(myOperation, new RegisterOptions());

            ILongOpObsService proxy = callerChannel.RealmProxy.Services.GetCalleeProxy <ILongOpObsService>();

            IEnumerable <int> results = proxy.LongOp(9, false).ToEnumerable(); // it will emit one more than asked

            CollectionAssert.AreEquivalent(Enumerable.Range(0, 10), results);
        }