public void Setup() { controlSubstitute = Substitute.For <IControl>(); connectedState = Substitute.For <IPhoneState>(); unconnectedState = Substitute.For <IPhoneState>(); _uut = new UsbChargerSimulator(connectedState, unconnectedState, controlSubstitute); _uut.Controller = controlSubstitute; }
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; }
public void UpdatePhoneState(IPhoneState state) { phoneState = state; }
public Phone() { State = new LockedPhoneState(this); }