public void Hour_Delete() { var hour = HourTestHelper.HourNew(); Assert.IsTrue(hour.IsValid, "IsValid should be true"); hour = HourRepository.HourSave(hour); hour = HourRepository.HourFetch(hour.HourId); HourRepository.HourDelete(hour.HourId); try { HourRepository.HourFetch(hour.HourId); } catch (Exception ex) { Assert.IsTrue(ex.GetBaseException() is InvalidOperationException); } }
public ActionResult Delete(int id, FormCollection collection) { HourRepository.HourDelete(id); return(this.RedirectToAction("Index", "Home")); }