Ejemplo n.º 1
0
        public static void AssertPowerWorks(this DeviceEmulator device, int?powerIndex)
        {
            var i = powerIndex ?? 1;

            device.Status.StatusSts.Power("OFF", powerIndex);

            device.ExecuteCommand($"power{i} ON");
            Assert.AreEqual("ON", device.Status.StatusSts.Power(powerIndex));

            device.ExecuteCommand($"power{i} OFF");
            Assert.AreEqual("OFF", device.Status.StatusSts.Power(powerIndex));

            device.ExecuteCommand($"power{i} TOGGLE");
            Assert.AreEqual("ON", device.Status.StatusSts.Power(powerIndex));

            device.ExecuteCommand($"power{i} TOGGLE");
            Assert.AreEqual("OFF", device.Status.StatusSts.Power(powerIndex));

            device.ExecuteCommand($"power{i} 1");
            Assert.AreEqual("ON", device.Status.StatusSts.Power(powerIndex));

            device.ExecuteCommand($"power{i} 0");
            Assert.AreEqual("OFF", device.Status.StatusSts.Power(powerIndex));

            device.ExecuteCommand($"power{i} 2");
            Assert.AreEqual("ON", device.Status.StatusSts.Power(powerIndex));

            device.ExecuteCommand($"power{i} 2");
            Assert.AreEqual("OFF", device.Status.StatusSts.Power(powerIndex));
        }
Ejemplo n.º 2
0
 public dynamic?ExecuteCommand(string?cmnd)
 {
     return(_device.ExecuteCommand(cmnd));
 }
Ejemplo n.º 3
0
 public Task Restart()
 {
     _logger.LogInformation("Received request to restart device.");
     _device.ExecuteCommand("Restart", "1");
     return(Task.CompletedTask);
 }