public void UpdateStatusToReturnedTest() { var borrowDal = new BorrowDal(); var customer = new Member { Email = "*****@*****.**", Password = "******" }; var media = new Media { InventoryId = 1 }; borrowDal.BorrowItem(customer, media, 1); var rentalId = this.getLastRentalTransactionID(); var rentalDal = new RentalDal(); rentalDal.UpdateStatus(rentalId, "Returned", 2, "New"); var result = rentalDal.RetrieveSelectRentedItems("Returned"); var selectedItem = result.First(item => item.RentalId == rentalId); this.deleteReturnCondition(rentalId); this.deleteStatusUpdates(rentalId); this.deleteRentalTransaction(rentalId, media); Assert.AreEqual("Returned", selectedItem.Status); }
public void RetrieveAllRentedItemsWithDeliveredForStatusTest() { var rentalDal = new RentalDal(); var result = rentalDal.RetrieveSelectRentedItems("Delivered"); Assert.AreEqual(0, result.Count); }