private void StartTimeTracking( string country, string city) { timerUtil = new TimerUtility( locationDetails, country, city); Timer = new Timer(timerUtil); }
private void GetFormattedLocationTime_TestHelper( int offset, string formattedInputTime, string expectedFormattedResult) { ITimerUtility timerInTest = GetInitializedTimer(offset); var inputDateTime = DateTime.Parse(formattedInputTime); var formattedTime = timerInTest.GetFormattedLocationTime(inputDateTime); Assert.AreEqual(expectedFormattedResult, formattedTime); }
public Timer(ITimerUtility timerUtil) { this.timerUtil = timerUtil; FormattedTime = timerUtil.GetFormattedLocationTime(DateTime.UtcNow); intervalTimer = new DispatcherTimer( timerUtil.GetMinuteUpdateInterval(DateTime.Now), DispatcherPriority.Normal, delegate { TimerElapsed(); }, Dispatcher.CurrentDispatcher); }