public void CallRemoteEvent()
        {
            FullService service = new FullService();
            RemoteObjectAddress address = ObjectServer.PublishObject(service);
            IFullService proxy = RemoteObjectProxyProvider.GetProxy<IFullService>(address);
            string result = string.Empty;
            // add event handler remotely
            proxy.Event += (sender, args) => { result = args.Text; };
            // raise the event locally on the remote site
            // (it calls our local handler attached to the event
            // which sets the result to the 'result' variable)
            proxy.RaiseEvent("foo");

            Assert.Equal("foo", result);
        }
        public void SetRemoteProperty()
        {
            FullService service = new FullService() { Property = 1 };
            RemoteObjectAddress address = ObjectServer.PublishObject(service);
            IFullService proxy = RemoteObjectProxyProvider.GetProxy<IFullService>(address);
            proxy.Property = 2;
            int value = proxy.Property;

            Assert.Equal(2, value);
        }
        public void CallRemoteMethod()
        {
            FullService service = new FullService();
            RemoteObjectAddress address = ObjectServer.PublishObject(service);
            IFullService proxy = RemoteObjectProxyProvider.GetProxy<IFullService>(address);
            string result = proxy.Method("foo");

            Assert.Equal("FOO", result);
        }
        public void GetProperty()
        {
            FullService service = new FullService() { Property = 42 };
            RemoteObjectAddress address = ObjectServer.PublishObject(service);
            IFullService proxy = RemoteObjectProxyProvider.GetProxy<IFullService>(address);

            Assert.Equal(42, proxy.Property);
        }