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 BorrowItemValidTest() { var borrowDal = new BorrowDal(); var customer = new Member { Email = "*****@*****.**", Password = "******" }; var media = new Media { InventoryId = 1 }; var rowCount = borrowDal.BorrowItem(customer, media, 1); this.cleanDataBase(media); Assert.AreEqual(3, rowCount); }