예제 #1
0
        public void AddDeckTest()
        {
            //Arrange
            DeckSqlDAL deckSql = new DeckSqlDAL(connectionString);

            //Act
            int newDeckID = int.Parse(deckSql.AddDeck("2", "SQL Test Add"));

            //Assert
            Assert.AreEqual(deckID + 1, newDeckID);
        }
예제 #2
0
        public ActionResult AddDeck(string user_id, Deck model)
        {
            user_id = Session["userid"].ToString();
            if (Session["userid"] == null)
            {
                return(RedirectToAction("Login", "Home"));
            }
            //user_id = CheckSession(user_id);
            if (Session["userid"] != null)
            {
                deckDAL.AddDeck(user_id, model.Name);
            }
            List <Deck> decks = deckDAL.GetDecksByUserID(user_id);

            return(RedirectToAction("Index"));
        }