예제 #1
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);
        }
예제 #2
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);
        }
예제 #3
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);
        }