Exemplo n.º 1
0
        public static Checklist SetChecklist(DevCard card)
        {
            var checklist = _trello.Checklists.Add("Acceptance Criteria", _board);
            checklist.CheckItems.Add(new CheckItem { Id = Guid.NewGuid().ToString(), Name = "Enter test 1 here...", Pos = 1 });

            string text = "Add test criteria here...";
            _trello.Checklists.AddCheckItem(checklist, !string.IsNullOrEmpty(card.AcceptanceCriteria) ? card.AcceptanceCriteria : text);
            return checklist;
        }
Exemplo n.º 2
0
        private static void SetTrelloLabel(DevCard ddd, Card bl)
        {
            foreach (var label in _lbls)
            {
                if (bl.Labels.Any(x => x.Name.ToLowerInvariant() == label.Name.ToLowerInvariant())) continue;

                if (ddd.ToString().ToLowerInvariant().Contains(label.Name.ToLowerInvariant()))
                {
                    bl.Labels.Add(label);
                    _trello.Cards.AddLabel(bl, label.Color.Value);
                }

                if (ddd.Priority.ToLowerInvariant().Contains(label.Name.ToLowerInvariant()))
                {
                    bl.Labels.Add(label);
                    _trello.Cards.AddLabel(bl, label.Color.Value);
                }
            }
        }
Exemplo n.º 3
0
        private static string GetCardName(DevCard devCard)
        {
            string cardname = null;
            if (string.IsNullOrEmpty(devCard.IWantTo))
            {
                cardname = devCard.ToString();
            }
            else
            {
                cardname = devCard.Feature + ":   " + devCard.IWantTo;
            }

            cardname = "(" + devCard.EstimatedHours + ") " + cardname;
            return cardname;
        }
Exemplo n.º 4
0
 private static void SetPriority(DevCard devCard, Card card, int count)
 {
     switch (devCard.Priority.ToLowerInvariant())
     {
         case "must":
             card.Pos = 1 * count;
             break;
         case "should":
             card.Pos = 2 * count;
             break;
         case "could":
             card.Pos = 3 * count;
             break;
         default:
             card.Pos = 4 * count;
             break;
     }
 }
Exemplo n.º 5
0
        private static List<DevCard> ExtractDevCards()
        {
            var worksheet = _pck.Workbook.Worksheets.First(x => x.Name == "Backlog");

                Console.WriteLine(worksheet.Name);

                var list = new List<DevCard>();

                var start = worksheet.Dimension.Start;
                var end = worksheet.Dimension.End;
                for (var row = start.Row; row <= end.Row; row++)
                {
                    if (row <= 1) continue;
                    if (row > 50) break;
                    Rows.Add(row);
                    var dc = new DevCard();
                    for (var col = start.Column; col <= end.Column; col++)
                    {
                        // ... Cell by cell...
                        object cellValue = worksheet.Cells[row, col].Text; // This got me the actual value I needed.
                        Debug.WriteLine(cellValue);
                        if (col > 50) break;
                        switch (col)
                        {
                            case 1:
                                dc.Milestone = Convert.ToString(cellValue);
                                break;
                            case 3:
                                dc.Feature = Convert.ToString(cellValue);
                                break;
                            case 4:
                                dc.AsA = Convert.ToString(cellValue);
                                break;
                            case 5:
                                dc.IWantTo = Convert.ToString(cellValue);
                                break;
                            case 6:
                                dc.SoThat = Convert.ToString(cellValue);
                                break;
                            case 7:
                                dc.Priority = Convert.ToString(cellValue);
                                break;
                            case 8:
                                var ss = Convert.ToString(cellValue);
                                var no = string.IsNullOrEmpty(ss) ? "5" : ss;
                                dc.EstimatedHours = Convert.ToInt16(no);
                                break;
                            case 9:
                                dc.Notes = Convert.ToString(cellValue);
                                break;
                        default:
                                int icol;
                                if (_columnIndexes.TryGetValue("UAC", out icol))
                                    if (icol == col)
                                    {
                                        dc.AcceptanceCriteria = Convert.ToString(cellValue);
                                    }
                                break;
                        }
                    }
                    list.Add(dc);
                }
                return list;
        }