Пример #1
0
        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);
        }
Пример #2
0
        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);
        }