Exemple #1
0
        public ActionResult Edit(int id)
        {
            BreakDataAccess breakDataAccess = new BreakDataAccess();
            BreakModel      model           = breakDataAccess.Read(id);

            return(View(model));
        }
Exemple #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);
        }
Exemple #3
0
        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);
        }