Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 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)));
 }