public void ThemPhieuThu(int id, string id_pt, string expected) { PHIEUTHUsController pHIEUTHUsController = new PHIEUTHUsController(); var result = pHIEUTHUsController.Create(id, id_pt) as ViewResult; Assert.AreEqual(result.ViewName, expected); }
public void ThemPhieuThuPost(string SoPhieuDK, string NgayLap, decimal SoTienThu, string expected) { PHIEUTHUsController pHIEUTHUsController = new PHIEUTHUsController(); PHIEUTHU pHIEUTHU = new PHIEUTHU { SoPhieuThu = "", SoPhieuDK = SoPhieuDK, NgayLap = Convert.ToDateTime(NgayLap), SoTienThu = SoTienThu, }; pHIEUTHUsController.Create(0, pHIEUTHU.SoPhieuThu); var result = pHIEUTHUsController.Create(pHIEUTHU) as RedirectToRouteResult; Assert.AreEqual(result.RouteValues["action"].ToString(), expected); }