Esempio n. 1
0
        public void GivenDeviceWithInvalidHdmiSwitchId_WhenGetState_ThenStateIsNull()
        {
            var device = new AtenVS0801H(_serviceClient, _settings.DeviceId, _invalidHdmiSwitchId);
            var state  = device.GetState();

            Assert.IsNull(state);
        }
Esempio n. 2
0
        public void GivenJsonThetChangesHDMIInputPortToPort8_WhenCommandDispatcherDispatch_ThenResultIsTrueAndInputPortIsPort8()
        {
            using (StreamReader r = new StreamReader(@".\TestAssets\command-processor-change-hdmi-input.json"))
            {
                string json = r.ReadToEnd();

                //Firstly, make sure HDMI ports on both switchers are set to 1
                _hdmiDevice0.SetInputPort(ControllableDeviceTypes.AtenVS0801HTypes.InputPort.Port1);
                _hdmiDevice1.SetInputPort(ControllableDeviceTypes.AtenVS0801HTypes.InputPort.Port1);

                //JSON commands should change both ports to 8
                _cd.Dispatch(json);

                //Read back and verify
                var hdmiDevice0State = _hdmiDevice0.GetState();
                Assert.IsTrue(hdmiDevice0State.InputPort == ControllableDeviceTypes.AtenVS0801HTypes.InputPort.Port8);

                var hdmiDevice1State = _hdmiDevice1.GetState();
                Assert.IsTrue(hdmiDevice1State.InputPort == ControllableDeviceTypes.AtenVS0801HTypes.InputPort.Port8);
            }
        }