Ejemplo n.º 1
0
        public void TestCreateDaoTao()
        {
            DaoTao dt = new DaoTao(nameMonHoc, nameGiangVien, khoa, nganh);
            dt.ID = id;
            var daoTaoControl = new DaoTaoController();
            var result = daoTaoControl._Create(dt) as RedirectToRouteResult;

            Assert.NotNull(result);
            Assert.AreEqual("Index", result.RouteValues["action"]);

            daoTaoControl.Delete(id);
        }
Ejemplo n.º 2
0
        public void TestEditDaoTao()
        {
            DaoTao dt = new DaoTao(nameMonHoc, nameGiangVien, khoa, nganh);
            dt.ID = id;
            var daoTaoControl = new DaoTaoController();
            daoTaoControl._Create(dt);
            var result = daoTaoControl.Edit(dt.ID) as ViewResult;
            var dTao = (DaoTao)result.ViewData.Model;

            Assert.AreEqual(nameMonHoc, dTao.tenMonHoc);

            daoTaoControl.Delete(id);
        }
Ejemplo n.º 3
0
        public void TestSearchDaoTao()
        {
            DaoTao dt = new DaoTao(nameMonHoc, nameGiangVien, khoa, nganh);
            dt.ID = id;
            var daoTaoControl = new DaoTaoController();
            daoTaoControl._Create(dt);

            var result = daoTaoControl.SearchDaoTao(nganh, khoa.ToString()) as ViewResult;
            Assert.NotNull(result);
            daoTaoControl.Delete(id);
        }