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); }
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")); }