Beispiel #1
0
        public async Task <ActionResult> Delete(int id)
        {
            BreakDataAccess breakDataAccess = new BreakDataAccess();

            breakDataAccess.Delete(id);

            return(RedirectToAction("List", "Break"));

            //AddErrors(result);



            // If we got this far, something failed, redisplay form
        }
Beispiel #2
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);
        }