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); }
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); }
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); }