Exemplo n.º 1
0
        public void ItCanLoadOnlyCardUpdateActions()
        {
            var actions = trelloClient.GetCardUpdateActions("HVOEKgf7");

            Assert.True(actions.Length > 0);
            Assert.AreEqual(actions.Count(a => a.Type == ActionType.CreateCard), 1);
            Assert.True(actions.Count(a => a.Type == ActionType.UpdateCard) > 0);
        }
Exemplo n.º 2
0
        public CardHistory Get(string cardId)
        {
            var updateActions = taskManagerClient.GetCardUpdateActions(cardId);
            var movements     = updateActions.Where(x => x.ToList != null && x.FromList != null)
                                .Select(BuildMovement)
                                .OrderBy(x => x.Date)
                                .ToArray();
            var createAction = updateActions.FirstOrDefault(a => a.Type == ActionType.CreateCard);

            return(new CardHistory
            {
                Movements = movements,
                CreateDate = createAction?.Date
            });
        }