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)); }
public dynamic?ExecuteCommand(string?cmnd) { return(_device.ExecuteCommand(cmnd)); }
public Task Restart() { _logger.LogInformation("Received request to restart device."); _device.ExecuteCommand("Restart", "1"); return(Task.CompletedTask); }