Exemplo n.º 1
0
 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"
     });
 }
Exemplo n.º 2
0
        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");
        }
Exemplo n.º 3
0
        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");
        }
Exemplo n.º 4
0
 public IEnumerable <Card> Load_all_cards()
 {
     return(CardStore.AllCards());
 }
Exemplo n.º 5
0
 public void Move_card_to_column(string cardId, int destinationColumnIndex)
 {
     CardStore.Change(cardId, destinationColumnIndex);
 }
Exemplo n.º 6
0
 public void Create_card(string text, int columnIndex)
 {
     CardStore.Add(new Card {
         ColumnIndex = columnIndex, Id = text.GetHashCode().ToString(), Text = text
     });
 }