public void Charging() { var output = new StringWriter(); Console.SetOut(output); uut.Charging(); Assert.That(output.ToString(), Is.EqualTo("Ladningen er igang:")); }
private void CurrentValueEventHandler(object sender, CurrentEventArgs args) { double current = args.Current; if (current == 0) { _display.ConnectMsg(); } else if (current > 0 && current <= 5) { _display.Fullycharged(); } else if (current > 5 && current <= 500) { _display.Charging(); } else if (current > 500) { _display.ErrorMsgCharge(); } }
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); }