Пример #1
0
        public IterationAnalysisResult AnalyzeRecentIterations(long projectId)
        {
            var result = new IterationAnalysisResult
            {
                Name = "Recent Iteration review",
                ProjectId = projectId,
            };

            var iterations = m_storyProvider.GetRecentIterations(projectId, 10);

            foreach (var iteration in iterations)
            {
                result.Items.Add(CreateTimeFramedResult(iteration.Stories, iteration.Start.Value, iteration.Finish.Value));
            }
            return result;
        }
Пример #2
0
        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;
        }