Ejemplo n.º 1
0
        public void GetSensorStates_DefaultValue()
        {
            var socket = new Socket(1, "Klaus-Dieter");

            var store  = new StateStore();
            var result = store.GetSensorStates(socket);

            Assert.Equal(new Dictionary <string, PowerStatus>(), result);
        }
Ejemplo n.º 2
0
        public void GetSensorStates_SetAndGet()
        {
            var socket = new Socket(1, "Klaus-Dieter");

            var store = new StateStore();

            store.SetSensorState(socket, "SoundDetector", PowerStatus.Off);
            var result = store.GetSensorStates(socket);

            Assert.Single(result);
            Assert.True(result.ContainsKey("SoundDetector"));
            Assert.Equal(PowerStatus.Off, result["SoundDetector"]);
        }