public TimedDoor(ITimer timer, IAlarm alarm, IDoor door) { _timer = timer; _alarm = alarm; _door = door; const int defaultTime = 30; _timer.SetTime(defaultTime); _timer.TimePassed += ((object e, EventArgs args) => { _alarm.Start(); }); }