public void SetUp()
        {
            _leanKitWebClient = Substitute.For <ILeanKitWebClient>();
            _tellTheTime      = Substitute.For <ITellTheTime>();

            _leanKitWebClient.GetBoardData().Returns(GetJsonResponse());
            _leanKitWebClient.GetCardDataFor(Arg.Any <int>()).Returns(CardDetailResponse());

            _tellTheTime.ParseDateToUkFormat(Arg.Any <string>()).Returns(new DateTime(2017, 10, 01));
        }
Ejemplo n.º 2
0
        private CardDate GetCardCreateDateFor(int cardId)
        {
            var cardData = _leanKitLeanKitWebClient.GetCardDataFor(cardId);

            var cardDetails = JsonConvert.DeserializeObject <RootObject>(cardData).ReplyData.First();

            var cardDate = new CardDate
            {
                CreateDate = DateTime.Parse(cardDetails.CreateDate)
            };

            if (!string.IsNullOrWhiteSpace(cardDetails.DoneDate))
            {
                cardDate.DoneDate = _tellTheTime.ParseDateToUkFormat(cardDetails.DoneDate);
            }

            return(cardDate);
        }