public BoardProviderMoc() { CardStore.Add(new Card { ColumnIndex = 0, Id = "A", Text = "Die A Karte" }); CardStore.Add(new Card { ColumnIndex = 1, Id = "C", Text = "Die C Karte" }); }
public void Create_Card_Test() { IBoardProvider2 boardProvider = new BoardProviderMoc(); IBoard2 board = new BoardMoc(); var boardController = new BoardController2(board, boardProvider); boardController.On_cards_changed += CardStore.OnCardChanged; var cardText = "A new card X"; boardController.Create_card(cardText, 2); var card = CardStore.AllCards().FirstOrDefault(c => c.Text == cardText); Assert.IsNotNull(card, "card is not contained"); Assert.AreEqual(card.ColumnIndex, 2, "columIndex is incorrect"); }
public void Move_Card_Test() { IBoardProvider2 boardProvider = new BoardProviderMoc(); IBoard2 board = new BoardMoc(); var boardController = new BoardController2(board, boardProvider); boardController.On_cards_changed += CardStore.OnCardChanged; var cardId = "A"; boardController.Move_card(cardId, 2); var card = CardStore.AllCards().FirstOrDefault(c => c.Id == "A"); Assert.IsNotNull(card, "card not found"); Assert.AreEqual(card.ColumnIndex, 2, "columIndex is incorrect"); }
public IEnumerable <Card> Load_all_cards() { return(CardStore.AllCards()); }
public void Move_card_to_column(string cardId, int destinationColumnIndex) { CardStore.Change(cardId, destinationColumnIndex); }
public void Create_card(string text, int columnIndex) { CardStore.Add(new Card { ColumnIndex = columnIndex, Id = text.GetHashCode().ToString(), Text = text }); }