Esempio n. 1
0
 public void CheckForMidnight()
 {
     if (switchAtMidnight && midnightCorrector != null)
     {
         midnightCorrector.PerformMidnightCorrection(currentActivity, timeLogsManager);
     }
 }
Esempio n. 2
0
        public void AfterMidnightActivityIsCut()
        {
            IActivity activity = NewMock <IActivity>();

            Stub.On(activity).GetProperty("Start").Will(Return.Value(DateTime.Parse("2008-08-07 23:59:55")));
            Stub.On(activity).GetProperty("End").Will(Return.Value(DateTime.Parse("2008-08-08 0:00:10")));
            using (Ordered)
            {
                Expect.Once.On(activity).SetProperty("Duration").To(TimeSpan.Parse("0:00:05"));
                Expect.Once.On(activity).SetProperty("Start").To(DateTime.Parse("2008-08-08"));
                Expect.Once.On(activity).SetProperty("Duration").To(TimeSpan.Parse("0:00:10"));
            }

            midnightSwitcher.PerformMidnightCorrection(activity, null);

            VerifyAllExpectationsHaveBeenMet();
        }