//TODO: add to Common.Testing => partial mocks
        protected override void Given()
        {
            base.Given();

            _timeService             = new TimeService();
            MockTimeService          = Substitute.For <ITimeService>();
            MockOpenDoorCommand      = Substitute.For <IOpenDoorCommand>();
            MockDelay                = Substitute.For <IDelay>();
            MockCheckForLightCommand = Substitute.For <ICheckForLightCommand>();

            SetupTasks();

            MockTimeService
            .MilisecondsInTimeSpan(Arg.Any <TimeSpan>())
            .Returns(args =>
            {
                var time = (TimeSpan)args[0];
                return(_timeService.MilisecondsInTimeSpan(time));
            });

            SUT = new CloseDoorWhenMorningSequenceBuilder(
                FluentSequenceBuilder,
                MockDelay,
                MockCheckForLightCommand,
                MockOpenDoorCommand,
                MockTimeService
                );
        }
 public CloseDoorWhenMorningSequenceBuilder(IFluentSequenceBuilder fluentSequenceBuilder, IDelay delay,
                                            ICheckForLightCommand checkForLightCommand, IOpenDoorCommand openDoorCommand, ITimeService timeService)
 {
     _fluentSequenceBuilder = fluentSequenceBuilder;
     _delay = delay;
     _checkForLightCommand = checkForLightCommand;
     _openDoorCommand      = openDoorCommand;
     _timeService          = timeService;
 }