예제 #1
0
        public void Charging()
        {
            var output = new StringWriter();

            Console.SetOut(output);

            uut.Charging();

            Assert.That(output.ToString(), Is.EqualTo("Ladningen er igang:"));
        }
예제 #2
0
        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();
            }
        }
예제 #3
0
        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);
        }