public IterationAnalysisResult CreateReleaseProjection(OverviewAnalysisResult overviewAnalysis, DateTime targetDate, int iterationlength, DateTime from) { var result = new IterationAnalysisResult { Name = overviewAnalysis.Name, ProjectId = overviewAnalysis.ProjectId, }; var iterationSpan = new TimeSpan(7 * iterationlength, 0, 0, 0); if (overviewAnalysis.CachedStories.Any()) { while (from + iterationSpan <= targetDate) { var iterationStories = overviewAnalysis.CachedStories.Where(e => IsInRange(e, from, iterationSpan)); if (iterationStories.Any()) { result.Items.Add(CreateTimeFramedResult(iterationStories.ToList(), from, from + iterationSpan)); } from += iterationSpan; } var remainingSpan = (targetDate - from).Days / iterationSpan.Days * 1m; if (remainingSpan > 0) { result.NeededAverageVelocity = (int)Math.Round(overviewAnalysis.TotalPointsLeft / remainingSpan); } else { result.NeededAverageVelocity = overviewAnalysis.TotalPointsLeft; } } return result; }
public OverviewModel(OverviewAnalysisResult result) { m_result = result; }
private OverviewAnalysisResult BuildOverViewResult(Predicate<Story> unplannedStoriesPoints, List<Story> stories) { var result = new OverviewAnalysisResult(); result.Velocity = m_projectVelocity; if (unplannedStoriesPoints != null) { result.UnplannedStoriesPoints = stories.Where(e => unplannedStoriesPoints(e) && e.Estimate.HasValue).Sum(e => e.Estimate.Value); } var bugs = stories.Where(e => e.StoryType == StoryType.Bug); result.TotalBugsCount = bugs.Count(); result.RemainingBugsCount = bugs.Count(e => !IsCompleted(e.Status)); result.FeaturesCount = stories.Count(e => e.StoryType == StoryType.Feature); result.UnestimatedStoriesCount = stories.Count(e => !IsEstimated(e)); result.TotalPointsCompleted = stories.Where(e => IsEstimated(e) && IsCompleted(e.Status)) .Sum(e => e.Estimate.Value); result.TotalPointsLeft = stories.Where(e => IsEstimated(e) && !IsCompleted(e.Status)) .Sum(e => e.Estimate.Value); return result; }