Esempio n. 1
0
        private void CancelBtn_Click(object sender, EventArgs e)
        {
            int reservationID = 0;
            var selectedItem  = ReservationLV.SelectedItems;

            if (selectedItem.Count == 1)
            {
                reservationID = Convert.ToInt32(selectedItem[0].SubItems[0].Text);
            }
            _adminPresenter.CancelReservation(reservationID);
            this.Refresh();
        }
Esempio n. 2
0
        public void CancelReservationTest()
        {
            bool success         = false;
            var  adminController = new AdminPresenter();
            var  bookController  = new BookPresenter();

            var successfullAdd = adminController.AddBook(reservationBook);

            bookController.Reserve(reservationBook.SerialNumber, user.Username);
            var reservation = reservationRepository.GetByBookId(reservationBook.SerialNumber);
            var book        = bookRepository.GetByID(reservationBook.SerialNumber);

            if (book.Status.Equals("Reserved"))
            {
                var successfullCancellation = adminController.CancelReservation(reservation.Id);
                success = successfullCancellation;
            }

            var successfulDelete = adminController.RemoveBook(reservationBook);

            Assert.IsTrue(success);
        }