public void ChargingError() { var output = new StringWriter(); Console.SetOut(output); uut.ChargingError(); Assert.That(output.ToString(), Is.EqualTo("!!!ERROR!!! Frakobel din telefon hurtigst: ")); }
private void _usbCharger_CurrentValueEvent(object sender, CurrentEventArgs e) { if (e.Current == 0) { } else if (e.Current > 0 && e.Current <= 5) { _display.ChargeComplete(); } else if (e.Current > 5 && e.Current <= 500) { _display.Charging(); } else if (e.Current > 500) { _display.ChargingError(); StopCharge(); } _display.CurrentPowerValue(e); }