示例#1
0
        public new ActionResult List()
        {
            BreakDataAccess   breakDataAccess = new BreakDataAccess();
            List <BreakModel> breakList       = breakDataAccess.List();

            return(View(breakList));
        }
示例#2
0
        public void ListTest()
        {
            BreakDataAccess   breakDataAccess = new BreakDataAccess();
            List <BreakModel> breakList       = breakDataAccess.List();

            Assert.IsTrue(breakList.Count > 0);
        }
示例#3
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);
        }
示例#4
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);
        }