Example #1
0
 public void Setup()
 {
     controlSubstitute = Substitute.For <IControl>();
     connectedState    = Substitute.For <IPhoneState>();
     unconnectedState  = Substitute.For <IPhoneState>();
     _uut            = new UsbChargerSimulator(connectedState, unconnectedState, controlSubstitute);
     _uut.Controller = controlSubstitute;
 }
Example #2
0
        public UsbChargerSimulator(IPhoneState connected, IPhoneState unConnected, IControl controller)
        {
            CurrentValue = 0.0;
            _overload    = false;

            _timer          = new System.Timers.Timer();
            _timer.Enabled  = false;
            _timer.Interval = CurrentTickInterval;
            _timer.Elapsed += TimerOnElapsed;

            //Phone States
            PhoneConnected   = connected;
            PhoneUnConnected = unConnected;
            PhoneState       = PhoneUnConnected;
        }
Example #3
0
 public void UpdatePhoneState(IPhoneState state)
 {
     phoneState = state;
 }
Example #4
0
 public Phone()
 {
     State = new LockedPhoneState(this);
 }