Created
May 15, 2012 13:33
-
-
Save bsommardahl/2701819 to your computer and use it in GitHub Desktop.
TapTimeCalculator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TapTimeCalculator : ITapTimeCalculator | |
{ | |
readonly ILastTappedHeatFetcher _lastTappedHeatFetcher; | |
public TapTimeCalculator(ILastTappedHeatFetcher lastTappedHeatFetcher) | |
{ | |
_lastTappedHeatFetcher = lastTappedHeatFetcher; | |
} | |
#region ITapTimeCalculator Members | |
public DateTime Calculate(DateTime predictedHeatStartTime) | |
{ | |
TappedHeat tappedHeat = _lastTappedHeatFetcher.Fetch(); | |
TimeSpan timeBetweenStartAndTapTimes = tappedHeat.ActualTapTime - tappedHeat.StartDate; | |
return predictedHeatStartTime.Add(timeBetweenStartAndTapTimes); | |
} | |
#endregion | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment