public ActionResult Edit(GeneratedRentalContract generatedrentalcontract) { if (ModelState.IsValid) { UnitofWork.GeneratedRentalContractRepository.Edit(generatedrentalcontract); UnitofWork.Save(); return RedirectToAction("Index"); } return View(generatedrentalcontract); }
public void Create() { //Act var newGeneratedContract = new GeneratedRentalContract { ID = 4, LandLoardName = null, LandLoardRole = null, LandLoradID = new Int32(), LandLoardAddress = null, TenantName = null, TenantID = new Int32(), PropertyID = new Int32(), PropertyAddress = null, PropertyCity = null, MonthlyRent = new Double(), BeginingDate = new Int32(), StartDate = new DateTime(), EndDate = new DateTime(), FirstMonthRent = new Double(), SecurityDeposit = new Double(), TotalPayment = new Double(), TenantRefundedNumberofDays = new Int32(), NoticeofMoveoutNumberofDays = new Int32(), LateFeeCharge = new Double(), PercentageofLateFeeCharge = new Int32(), LateFeeStartingDay = new Int32(), ExceptedUtilites = null, PetDeposit = new Double(), PetMonthly = new Double(), ParkingSpaceNumber = null, ParkingFee = new Double() }; Controller.Create(newGeneratedContract); var actual = Controller.Index(); // Assert var viewResult = actual as ViewResult; if (viewResult == null) return; var data = viewResult.ViewData.Model as IList<TenantShowing>; if (data != null) Assert.AreEqual(4, data.Count); }
public GeneratedRentalContract FirstGeneratedRentalContract() { var firstGeneratedRentalContract = new GeneratedRentalContract { ID = 1 , LandLoardName = null, LandLoardRole = null, LandLoradID = new Int32(), LandLoardAddress = null, TenantName = null, TenantID = new Int32(), PropertyID = new Int32(), PropertyAddress = null, PropertyCity = null, MonthlyRent = new Double(), BeginingDate = new Int32(), StartDate = new DateTime(), EndDate = new DateTime(), FirstMonthRent = new Double(), SecurityDeposit = new Double(), TotalPayment = new Double(), TenantRefundedNumberofDays = new Int32(), NoticeofMoveoutNumberofDays = new Int32(), LateFeeCharge = new Double(), PercentageofLateFeeCharge = new Int32(), LateFeeStartingDay = new Int32(), ExceptedUtilites = null, PetDeposit = new Double(), PetMonthly = new Double(), ParkingSpaceNumber = null, ParkingFee = new Double() }; return firstGeneratedRentalContract; }