public void E_EliminarEvent() { ListEventsViewModel a = new ListEventsViewModel(); a.fill(); int codigo = a.ListEvents[a.ListEvents.Count - 1].idEvent; Event objSector = new Event(); objSector.idEvent = codigo; AddEditEventViewModel objViewModel = new AddEditEventViewModel(); objViewModel.EliminarEvent(objSector.idEvent); Assert.True(true); }
public ActionResult DeleteEvento(int eventid) { AddEditEventViewModel objViewModel = new AddEditEventViewModel(); try { objViewModel.EliminarEvent(eventid); TempData["Mensaje"] = "El evento se se eliminó correctamente"; return(RedirectToAction("ListEvents")); } catch (Exception e) { TempData["MensajeError"] = "Error! " + e.Message.ToList(); return(RedirectToAction("ListEvents")); } }