public TimeManager(ITimeSystem timeSystem, ITimeLogsManager timeLogsManager) { currentActivity = new RunningActivity(FIRST_ACTIVITY, timeSystem); midnightCorrector = new MidnightSwitcher(); if (timeLogsManager != null) { TimeLogsManager = timeLogsManager; timeLogsManager.ActivateTimeLog(currentActivity.Start.Date); } }
public TimeManager(ITimeSystem timeSystem, ITimeLogsManager timeLogsManager) { currentActivity = new RunningActivity(FIRST_ACTIVITY, timeSystem); midnightCorrector = new MidnightSwitcher(); if (timeLogsManager != null) { TimeLogsManager = timeLogsManager; timeLogsManager.ActivateTimeLog(currentActivity.Start.Date); } }
public void CheckForMidnightCallsPerformMidnightCorrection() { IMidnightCorrector midnightCorrector = NewMock <IMidnightCorrector>(); Expect.Once.On(midnightCorrector).Method("PerformMidnightCorrection"); timeManager.MidnightCorrector = midnightCorrector; timeManager.SwitchAtMidnight = true; timeManager.CheckForMidnight(); VerifyAllExpectationsHaveBeenMet(); }