Exemplo n.º 1
0
        public void SubscribeBeforeSetParam()
        {
            var server = new ParameterServer(new Uri("http://localhost"));

            var slave = new SlaveServer("test", 0, new TopicContainer());
            var observer = new ReplaySubject<KeyValuePair<string, object>>();

            slave.ParameterUpdated += (key, value) => observer.OnNext(new KeyValuePair<string, object>(key, value));

            server.SubscribeParam("test", slave.SlaveUri.ToString(), "test_param");

            server.SetParam("test", "test_param", 5678);

            observer.First().Key.Is("test_param");
            observer.First().Value.Is(5678);
        }
        public void SubscribeBeforeSetParam()
        {
            var server = new ParameterServer(new Uri("http://localhost"));

            var slave    = new SlaveServer("test", 0, new TopicContainer());
            var observer = new ReplaySubject <KeyValuePair <string, object> >();

            slave.ParameterUpdated += (key, value) => observer.OnNext(new KeyValuePair <string, object>(key, value));

            server.SubscribeParam("test", slave.SlaveUri.ToString(), "test_param");

            server.SetParam("test", "test_param", 5678);

            observer.First().Key.Is("test_param");
            observer.First().Value.Is(5678);
        }