Ejemplo n.º 1
0
        public void GivenDeviceWithInvalidHdmiSwitchId_WhenSetInput_ThenSuccessIsFalse()
        {
            var device  = new AtenVS0801H(_serviceClient, _settings.DeviceId, _invalidHdmiSwitchId);
            var success = device.SetInputPort(InputPort.Port1);

            Assert.IsFalse(success);
        }
Ejemplo 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);
            }
        }