public void setstatusTest() { int id = 3; int status = 3; PlanDAO pDAO = new PlanDAO(); Plan actual = pDAO.showPlanInfo(id); int temp = actual.status; actual.status = status; pDAO.setStatus(id, status); Plan expect = pDAO.showPlanInfo(id); Assert.AreEqual(actual.status, expect.status); pDAO.setStatus(id, temp); }
//******************************************************************************************************************** //Изменение //******************************************************************************************************************** public ActionResult SetPlanStatus(int id, int status) { if (pDAO.setStatus(id, status)) { return(RedirectToAction("ShowPlanInfo", new { id = id })); } else { return(View("Index")); } }