Пример #1
0
        //create new card
        public ActionResult CardConstruct()
        {
            if (Session["userid"] == null)
            {
                return(RedirectToAction("Login", "Home"));
            }
            TagsSqlDAL tDal = new TagsSqlDAL(connectionString);

            ViewBag.allTags = tDal.TagDictionary;
            return(View("CardCreate"));
        }
Пример #2
0
            public void TagListTest()
            {
                //Arrange
                TagsSqlDAL tagSql = new TagsSqlDAL(connectionString);

                //Act
                List <string> tagList = tagSql.TagList;

                //Assert
                Assert.AreEqual(numTags + 1, tagList.Count);
            }
Пример #3
0
            public void AddTagToCardTest()
            {
                //Arrange
                TagsSqlDAL tagSql = new TagsSqlDAL(connectionString);

                //Act
                bool          success = tagSql.AddTagToCard(cardID.ToString(), tagID.ToString());
                List <string> tagList = tagSql.GetTagsByCardID(cardID.ToString());

                //Assert
                Assert.IsTrue(success);
                Assert.AreEqual(1, tagList.Count);
            }
Пример #4
0
            public void AddTagTest()
            {
                //Arrange
                TagsSqlDAL tagSql = new TagsSqlDAL(connectionString);

                //Act
                int newTagID      = int.Parse(tagSql.AddTag("SQL Test Add"));
                int existingTagID = int.Parse(tagSql.AddTag("SQL Test Add"));

                //Assert
                Assert.AreEqual(tagID + 1, newTagID);
                Assert.AreEqual(newTagID, existingTagID);
            }
Пример #5
0
        public void ThisDeckTagsTest()
        {
            //Arrange
            DeckSqlDAL deckSql  = new DeckSqlDAL(connectionString);
            TagsSqlDAL tagsDAL  = new TagsSqlDAL(connectionString);
            Deck       testDeck = deckSql.GetDeckByDeckID(deckID.ToString());

            //Act
            testDeck.AddTagToDeck("Deck Model Test");
            List <string> deckTags = testDeck.ThisDeckTags;

            //Assert
            Assert.AreEqual("Deck Model Test", deckTags[0]);
        }
Пример #6
0
        public void RemoveTagFromCard(string tagName)
        {
            TagsSqlDAL tagsSql = new TagsSqlDAL(connectionString);

            tagsSql.RemoveTagFromCard(CardID, tagName);
        }
Пример #7
0
        /// <summary>
        /// Adds a Tag to an individual card in a current instance.
        /// </summary>
        /// <param name="tagName"></param>
        public void AddTagToCard(string tagName)
        {
            TagsSqlDAL tagsSql = new TagsSqlDAL(connectionString);

            tagsSql.AddTagToCard(CardID, tagName);
        }