public new ActionResult List() { BreakDataAccess breakDataAccess = new BreakDataAccess(); List <BreakModel> breakList = breakDataAccess.List(); return(View(breakList)); }
public void ListTest() { BreakDataAccess breakDataAccess = new BreakDataAccess(); List <BreakModel> breakList = breakDataAccess.List(); Assert.IsTrue(breakList.Count > 0); }
public void DeleteTest() { BreakDataAccess breakDataAccess = new BreakDataAccess(); List <BreakModel> breakList = breakDataAccess.List(); // This method will be executed after the CreateTest, so items should exist if (breakList == null || breakList.Count == 0) { Assert.Fail(); } BreakModel model = breakList[0]; breakDataAccess.Delete(model.Id); model = breakDataAccess.Read(model.Id); Assert.IsNull(model); }
public void EditTest() { BreakDataAccess breakDataAccess = new BreakDataAccess(); List <BreakModel> breakList = breakDataAccess.List(); // This method will be executed after the CreateTest, so items should exist if (breakList == null || breakList.Count == 0) { Assert.Fail(); } string newName = "New Name"; BreakModel model = breakList[0]; model.Name = newName; breakDataAccess.Update(model); model = breakDataAccess.Read(model.Id); Assert.AreEqual(newName, model.Name); }