Example #1
0
        public void AddCardToDeckTest()
        {
            //Arrange
            DatabaseSvc testDAL = new DatabaseSvc(_connectionString);

            //Act
            List <CardItem> oldCards = testDAL.GetAllCardsForDeck(_deckId1);
            DeckItem        deck     = testDAL.AddCardToDeck(_cardId2, _deckId1);
            List <CardItem> newCards = testDAL.GetAllCardsForDeck(_deckId1);

            //Assert
            Assert.AreEqual(1, (newCards.Count() - oldCards.Count()), "Confirm number of cards");
            Assert.AreEqual(TestCard1Term, newCards[0].Term, "Confirm old card term");
            Assert.AreEqual(TestCard2Term, newCards[1].Term, "Confirm new card term");
        }
Example #2
0
        public void GetAllCardsInDeckTest()
        {
            //Arrange
            DatabaseSvc testDAL = new DatabaseSvc(_connectionString);

            //Act
            List <CardItem> cards = testDAL.GetAllCardsForDeck(_deckId1);

            //Assert
            Assert.AreEqual(1, cards.Count(), "Confirm number of tags");
            Assert.AreEqual(TestCard1Term, cards[0].Term);
        }