Пример #1
0
        public void GetAllTagsForCardTest()
        {
            //Arrange
            DatabaseSvc testDAL = new DatabaseSvc(_connectionString);

            //Act
            List <TagItem> tags = testDAL.GetAllTagsForCard(_cardId1);

            //Assert
            Assert.AreEqual(2, tags.Count(), "Confirm number of tags");
            Assert.AreEqual(TestTag1Name, tags[0].TagName);
            Assert.AreEqual(TestTag2Name, tags[1].TagName);
        }
Пример #2
0
        public void RemoveCardFromDeckTest()
        {
            //Arrange
            DatabaseSvc testDAL = new DatabaseSvc(_connectionString);

            int    cardId  = _cardId1;
            string tagName = TestTag1Name;

            //Act
            int  oldTagCount        = testDAL.GetAllTagsForCard(cardId).Count();
            bool tagDeletionSuccess = testDAL.RemoveTagFromCard(tagName, cardId);
            int  newTagCount        = testDAL.GetAllTagsForCard(cardId).Count();
            bool removedTag         = false;

            if (oldTagCount - newTagCount == 1)
            {
                removedTag = true;
            }

            //Assert
            Assert.AreEqual(true, tagDeletionSuccess, "Confirm method success");
            Assert.AreEqual(true, removedTag, "Confirm removal from database");
        }