Skip to content

Instantly share code, notes, and snippets.

@bsommardahl
Created May 15, 2012 13:33
Show Gist options
  • Save bsommardahl/2701819 to your computer and use it in GitHub Desktop.
Save bsommardahl/2701819 to your computer and use it in GitHub Desktop.
TapTimeCalculator
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