Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
        public void CheckForMidnightCallsPerformMidnightCorrection()
        {
            IMidnightCorrector midnightCorrector = NewMock <IMidnightCorrector>();

            Expect.Once.On(midnightCorrector).Method("PerformMidnightCorrection");
            timeManager.MidnightCorrector = midnightCorrector;
            timeManager.SwitchAtMidnight  = true;

            timeManager.CheckForMidnight();

            VerifyAllExpectationsHaveBeenMet();
        }