Ejemplo n.º 1
0
        public void DetailTinh()
        {
            TINHsController tinhController = new TINHsController();

            ViewResult result = tinhController.Details("0039") as ViewResult;

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Model);
        }
Ejemplo n.º 2
0
        public void CreateViewTinh()
        {
            TINHsController tinhController = new TINHsController();

            ViewResult result = tinhController.Create() as ViewResult;

            Assert.IsNotNull(result);
            string expected = "";
            string actual   = result.ViewName;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void CreatePostTinh()
        {
            TINHsController tinhController = new TINHsController();

            tinhController.DeleteConfirmed("0002");
            TINH tinh = new TINH {
                MaTinh = "0002", TenTinh = "Hồ Chí Minh"
            };
            RedirectToRouteResult result = tinhController.Create(tinh) as RedirectToRouteResult;

            Assert.IsNotNull(result);
            string expected = "Index";
            string actual   = result.RouteValues["action"].ToString();

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        public void EditViewTinh()
        {
            TINHsController tinhController = new TINHsController();

            TINH tinh = new TINH {
                MaTinh = "0002", TenTinh = "Hồ Chí Minh"
            };

            tinhController.Create(tinh);
            ViewResult result = tinhController.Edit("0002") as ViewResult;

            Assert.IsNotNull(result);
            string expected = "";
            string actual   = result.ViewName;

            Assert.AreEqual(expected, actual);
        }