internal void Check(HardwareTest caller, string name) { var status = caller.GetUserInput($"Is the PIM Mini ready for the CCP {caller.Name} test?"); if (!caller.AssertEqual(true, status, "The user indicated that the test is not ready.")) { return; } string message = $"comms_{this.Name}_{name}"; var result = Controller.SendTcpMessage(message); if (!caller.AssertEqual(result, DaemonResponse.Success, "")) { return; } caller.TestStatus = Status.Passed; }
/// <summary> /// Sets LEDs /// </summary> /// <param name="caller">The caller instance</param> /// <param name="level">true is on, false is off</param> /// <returns></returns> internal void Check(HardwareTest caller) { var result = this.SetLED(caller, true); if (result == DaemonResponse.Success) { bool userInput = caller.GetUserInput($"Is the {caller.Name} LED on?"); caller.AssertEqual(userInput, true, $"The {caller.Name} LED could not be turned on."); } else { caller.AssertEqual(result, DaemonResponse.Success, $"Could not set the {caller.Name} LED"); // this fails the test } var resetResult = this.SetLED(caller, false); if (!caller.AssertEqual(resetResult.ToString(), DaemonResponse.Success.ToString(), $"The {caller.Name} LED could not be turned off")) { return; } caller.TestStatus = Status.Passed; }
internal DaemonResponse SetLED(HardwareTest caller, bool level) { string ledLevel = level == true ? "on" : "off"; return(Controller.SendTcpMessage("LED_" + caller.Name.Replace(" ", "") + "_" + ledLevel)); }