protected void AssertCurrentLogicalPeriod(bool expectedActive, TimeSpan expectedLength) { ActivityPeriod activityPeriod = statsReporter.GetCurrentLogicalPeriod(); Assert.AreEqual(expectedActive, activityPeriod is ActivePeriod); Assert.AreEqual(expectedLength, activityPeriod.Length); }
private void UpdateStats(StatsReporter reporter) { UpdateLabels( (int)reporter.GetTotalActiveToday(DateTime.Now.Date).Round(100.ms()).TotalSeconds, (int)reporter.GetLastInactiveTimespan().Round(100.ms()).TotalSeconds ); ActivityPeriod currentActivityPeriod = reporter.GetCurrentLogicalPeriod(); UpdateNotifyIcon(currentActivityPeriod is ActivePeriod, (int)currentActivityPeriod.Length.TotalMinutes); UpdateAlldayIcon(reporter.GetTotalActiveToday(DateTime.Now.Date)); UpdateHistoryWindow(); }