public ActionResult Survey(SurveyModel post) { surveyDAL.SaveNewPost(post); if (!ModelState.IsValid) { return(View("Survey", post)); } return(RedirectToAction("SurveyResult", "Home")); }
public void SavePostTest() { SurveyModel model = new SurveyModel() { FavoritePark = "Everglades National Park", Email = "*****@*****.**", Residence = "OH", ActivityLevel = "Low" }; SurveySqlDAL dal = new SurveySqlDAL(connectionString); bool result = dal.SaveNewPost(model); Assert.AreEqual(true, result); }