protected override void Because() { cardId = Guid.NewGuid(); _input = new CardReadyInput { Id = cardId, Status = false }; _card.Stub(c => c.Status).PropertyBehavior(); _card.Stub(c => c.Column).Return(Stubs.WorkColumn); _cardService.Stub(x => x.GetCard(cardId)).Return(_card); _action.Command(_input); }
public AjaxResponse Command(CardReadyInput model) { var card = _cardService.GetCard(model.Id); card.Status = model.Status ? CardStatus.Ready : CardStatus.New; if (card.Column.Name != Core.Domain.BoardColumn.BacklogName && card.Column.Name != Core.Domain.BoardColumn.ArchiveName) { if (card.Status == CardStatus.Ready) card.StartIdle(); else card.StartWorking(); } _cardService.SaveCard(card); return new AjaxResponse() { Success = true }; }