Esempio n. 1
0
        private IEnumerable<OtfsTask> IterarWorkItemsCollection(WorkItemCollection collection, OtfsIteration iteration = null)
        {
            foreach (WorkItem item in collection)
            {
                var task = WorkItenFactory<OtfsTask>.Build(item);
                task.Comitar(iteration);

                yield return task;
            }
        }
        public IEnumerable<OtfsBacklogItem> ItensEmAndamento(OtfsIteration[] iterations)
        {
            var backlogItems = new List<OtfsBacklogItem>();

            foreach (var iteration in iterations)
            {
                var queryBacklogItems = QueryOtfsBacklogItems(OtfsBacklogItemState.Approved, iteration);
                backlogItems.InsertRange(0, queryBacklogItems);
            }

            return backlogItems;
        }
        public IEnumerable<OtfsBacklogItem> ItensConcluidos(OtfsIteration[] iterations)
        {
            var backlogItems = new List<OtfsBacklogItem>();

            foreach (var iteration in iterations)
            {
                var queryBacklogItems = QueryOtfsBacklogItems(OtfsBacklogItemState.Done, iteration, true);
                backlogItems.InsertRange(0, queryBacklogItems);
            }

            return backlogItems;
        }
        public IEnumerable<OtfsBacklogItem> ItensParaBuild(OtfsIteration[] iterations)
        {
            var backlogItems = new List<OtfsBacklogItem>();

            foreach (var iteration in iterations)
            {
                var queryBacklogItems = QueryIterationByStatus(OtfsBacklogItemState.Committed, iteration);
                var itens = queryBacklogItems.Where(OtfsBacklogItem.QueryBacklogItemParaBuild);

                backlogItems.InsertRange(0, itens);
            }

            return backlogItems;
        }
        public OtfsBacklogItemCollection LocalizarPorIteracao(OtfsIteration iteration)
        {
            string query = "Select * " +
                           "From WorkItems " +
                           "Where [Work Item Type] = @Type"+
                           "      and [Assigned To] = @User" +
                           "      and [State] <> @State" +
                           "      and [Iteration Path] under @Path";

            var param = new Dictionary<string, string>();
            param.Add("User", this.UsuarioAutenticado());
            param.Add("Type", "Product Backlog Item");
            param.Add("State", "Removed");
            param.Add("Path", iteration.Path);

            var backlogItens = Execute(query, param, iteration);

            return new OtfsBacklogItemCollection
            {
                BacklogsItemsPendentes = backlogItens.Where(OtfsBacklogItem.QueryBacklogItemPendente),
                BacklogsItemsAndamento = backlogItens.Where(OtfsBacklogItem.QueryBacklogItemAndamento),
                BacklogsItemsParaTestes = backlogItens.Where(OtfsBacklogItem.QueryBacklogItemParaTestes),
                BacklogsItemsConcluidas = backlogItens.Where(OtfsBacklogItem.QueryBacklogItemConcluidas),
                BacklogsItemsParaBuild = backlogItens.Where(OtfsBacklogItem.QueryBacklogItemParaBuild),
                BacklogsItemsPublicados = backlogItens.Where(OtfsBacklogItem.QueryBacklogItemPublicado)
            };
        }
 public IEnumerable<OtfsBacklogItem> ItensParaBuild(OtfsIteration iteration = null)
 {
     var backlogItens = QueryIterationByStatus(OtfsBacklogItemState.Committed, iteration);
     return backlogItens.Where(OtfsBacklogItem.QueryBacklogItemParaBuild);
 }
        private IEnumerable<OtfsBacklogItem> QueryOtfsBacklogItems(OtfsBacklogItemState state, OtfsIteration iteration = null, bool all = false, OtfsProjectId projectId = null)
        {
            var user = all ? string.Empty : "[Assigned To] = @User and ";
            var iterator = iteration == null ? string.Empty : " and [Iteration Path] under @Path";
            var project_Id = projectId == null ? string.Empty : " and [ProjectId] under @ProjectId";

            string query = "Select * " +
                           "From WorkItems " +
                           "Where [Work Item Type] = @Type and " + user +
                           "      [State] = @State" + iterator;

            var param = new Dictionary<string, string>();
            param.Add("State", state.ToString());
            param.Add("User", this.UsuarioAutenticado());
            param.Add("Type", "Product Backlog Item");
            param.Add("Path", iteration.Path);
            if (projectId != null)
               param.Add("ProjectId", projectId.Id.ToString());

            return Execute(query, param, iteration);
        }
        private IEnumerable<OtfsBacklogItem> QueryIterationByStatus(OtfsBacklogItemState state, OtfsIteration iteration)
        {
            string query = "Select * " +
                           "From WorkItems " +
                           "Where [Work Item Type] = @Type and " +
                           "      [State] = @State and " +
                           "      [Iteration Path] under @Path";

            var param = new Dictionary<string, string>();
            param.Add("State", state.ToString());
            param.Add("Type", "Product Backlog Item");
            param.Add("Path", iteration.Path);

            return Execute(query, param, iteration);
        }
        private IEnumerable<OtfsBacklogItem> IterarWorkItemsCollection(WorkItemCollection collection, OtfsIteration iteration)
        {
            foreach (WorkItem item in collection)
            {
                var backlogItem = WorkItenFactory<OtfsBacklogItem>.Build(item);

                backlogItem.AdicionarTags(item.Tags.Replace(" ", ""));
                backlogItem.Comitar(iteration);

                yield return backlogItem;
            }
        }
Esempio n. 10
0
        private IEnumerable<OtfsBacklogItem> Execute(string query, Dictionary<string, string> param, OtfsIteration iteration)
        {
            var workItem = Context.TeamProjectCollection.GetService<WorkItemStore>();
            var result = new Query(workItem, query, param).RunQuery();

            return IterarWorkItemsCollection(result, iteration).ToList();
        }
Esempio n. 11
0
 internal OtfsBacklogItemMetrics GerarMetricasDaIteracao(OtfsIteration iteration)
 {
     var backlogItens = LocalizarPorIteracao(iteration);
     return backlogItens.GerarMetricas();
 }
Esempio n. 12
0
 public IEnumerable<OtfsBacklogItem> LocalizarPorStatus(OtfsBacklogItemState state, OtfsIteration iteration = null)
 {
     return QueryOtfsBacklogItems(state, iteration);
 }
Esempio n. 13
0
 public void Comitar(OtfsIteration iteration)
 {
     this.Iteration = iteration;
 }
Esempio n. 14
0
 public static Func<OtfsIteration, bool> IteracaoAnterior(OtfsIteration corrente)
 {
     return x => x.EndDate < corrente.StartDate;
 }
Esempio n. 15
0
 public void AgendarIteracao(OtfsIteration iteration)
 {
     _iterations.Add(iteration);
 }