public void ChangeRentDateTest(int index, int year, int month, int day) { DateTime newDate = new DateTime(year, month, day); rentLogic.ChangeRentDate(index, newDate); Assert.That(rentLogic.GetRentById(index).RentDate, Is.EqualTo(newDate)); }
public IActionResult ModifyRental(int PersonRef, int GameRef, DateTime RentDate, DateTime ReturnDate, int Id) { if (rentLogic.GetRentById(Id).PersonRef != PersonRef) { rentLogic.ChangePersonRef(Id, PersonRef); } if (rentLogic.GetRentById(Id).GameRef != GameRef) { rentLogic.ChangeGameRef(Id, GameRef); } if (rentLogic.GetRentById(Id).RentDate != RentDate) { rentLogic.ChangeRentDate(Id, RentDate); } if (rentLogic.GetRentById(Id).ReturnDate != ReturnDate) { rentLogic.ChangeReturnDate(Id, ReturnDate); } return(RedirectToAction(nameof(GetRentals))); }