//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"));
        }
            public void TagListTest()
            {
                //Arrange
                TagsSqlDAL tagSql = new TagsSqlDAL(connectionString);

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

                //Assert
                Assert.AreEqual(numTags + 1, tagList.Count);
            }
            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);
            }
            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);
            }
        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]);
        }
Exemple #6
0
        public void RemoveTagFromCard(string tagName)
        {
            TagsSqlDAL tagsSql = new TagsSqlDAL(connectionString);

            tagsSql.RemoveTagFromCard(CardID, tagName);
        }
Exemple #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);
        }