Example #1
0
        public void InvoiceAccessorGet()
        {//updated
            List <HotelGuest> guest = HotelGuestAccessor.HotelGuestGet(100);
            int id = (int)guest[guest.Count - 1].HotelGuestID;

            Invoice invoice = InvoiceAccessor.GetInvoiceByGuest(id);

            Assert.AreEqual(id, invoice.HotelGuestID);
        }
Example #2
0
        public void TestVerifyGuestPINBookingAccessor()
        {   //Pulls a guest from the database and collects the guest information
            List <HotelGuest> guest1 = HotelGuestAccessor.HotelGuestGet(100);
            //Checks using a pin in the database, stores guest info from database into a guest object
            //Asserts that a record is found, that guest is not null by passing the guest1 guest pin
            HotelGuest guest = BookingAccessor.VerifyHotelGuestPin(guest1[guest1.Count - 1].GuestPIN);

            Assert.IsNotNull(guest);
        }
Example #3
0
        public void InvoiceManagerGetGuestBookingDetailsList()
        {
            List <BookingDetails> guestBookings = null;
            List <HotelGuest>     guest         = HotelGuestAccessor.HotelGuestGet();
            int id = (int)guest[0].HotelGuestID;

            guestBookings = access.RetrieveGuestBookingDetailsList(id);
            Assert.IsNotNull(guestBookings);
        }
Example #4
0
        public void InvoiceManagerGetByBooking()
        {
            List <BookingDetails> guestBookings = null;
            List <HotelGuest>     guest         = HotelGuestAccessor.HotelGuestGet();
            int id = (int)guest[guest.Count - 1].HotelGuestID;

            guestBookings = access.RetrieveGuestBookingDetailsList(id);
            Assert.AreNotEqual(null, guestBookings);
        }
Example #5
0
        public void InvoiceManagerGetByGuest()
        {   //Updated Test- Grabs hotel guest by id
            List <HotelGuest> guest = HotelGuestAccessor.HotelGuestGet(100);
            int id = (int)guest[guest.Count - 1].HotelGuestID;
            //Grabs invoice by guest id
            Invoice invoice = access.RetrieveInvoiceByGuest(id);

            Assert.AreEqual(id, invoice.HotelGuestID);
        }
Example #6
0
        public void HotelAccessorGet()
        {
            //calls generic Test accessor to grab the guestID
            int guestID = TestCleanupAccessor.GetHotelGuest();
            //Calls to the accessor method
            List <HotelGuest> guest = HotelGuestAccessor.HotelGuestGet(guestID);

            //Asserts that the firstname of the in the list corresponds to the dummy record first name
            Assert.AreEqual("Fake", guest[guest.Count - 1].FirstName);
        }
Example #7
0
        public void InvoiceAccessorGuestBooking()
        {
            List <BookingDetails> guestBookings = null;
            List <HotelGuest>     guest         = HotelGuestAccessor.HotelGuestGet();
            int id = (int)guest[guest.Count - 1].HotelGuestID;

            guestBookings = InvoiceAccessor.GetInvoiceBookingsByGuest(id);

            Assert.AreNotEqual(null, guestBookings);
        }
Example #8
0
        public void InvoiceManagerCheckArchiveInvoiceFail()
        {
            List <HotelGuest> listGuest = HotelGuestAccessor.HotelGuestGet();
            int id = (int)listGuest[1].HotelGuestID;
            List <BookingDetails> guestBookings = access.RetrieveGuestBookingDetailsList(id);
            var invoices = access.RetrieveActiveInvoiceDetails();
            var invoice  = invoices[1];
            var result   = access.CheckToArchiveInvoice(invoice, guestBookings);

            Assert.AreEqual(ResultsArchive.CannotArchive, result);
        }
Example #9
0
        public void HotelAccessorUpdate()
        {
            //gets the guestID from the Test accessor
            int guestID = TestCleanupAccessor.GetHotelGuest();
            //passes guestID to the HotelGuestAccessor method to grab the guest.
            List <HotelGuest> guest = HotelGuestAccessor.HotelGuestGet(guestID);
            int hotelGuest          = guest.Count - 1;

            guest.Add(new HotelGuest((int)guest[hotelGuest].HotelGuestID, guest[hotelGuest].FirstName, guest[hotelGuest].LastName, guest[hotelGuest].Address1, guest[hotelGuest].Address2, guest[hotelGuest].CityState, guest[hotelGuest].PhoneNumber, guest[hotelGuest].EmailAddress, guest[hotelGuest].Room, guest[hotelGuest].GuestPIN, false));
            int changed = HotelGuestAccessor.HotelGuestUpdate(guest[guest.Count - 2], guest[hotelGuest]);

            Assert.AreEqual(1, changed);
        }
Example #10
0
 /// <summary>
 /// Miguel Santana
 /// Created: 2015/02/12
 ///
 /// Gets a hotel guest by id
 /// </summary>
 /// <remarks>
 /// Rose Steffensmeier
 /// Updated: 2015/03/12
 /// Updated try/catch blocks
 /// </remarks>
 /// <param name="hotelGuestId">the id of a hotel guest to retrieve</param>
 /// <returns>HotelGuest object retrieved from database</returns>
 public HotelGuest GetHotelGuest(int hotelGuestId)
 {
     try
     {
         List <HotelGuest> list = HotelGuestAccessor.HotelGuestGet(hotelGuestId);
         return((list.Count == 1) ? list.ElementAt(0) : null);
     }
     catch (ApplicationException)
     {
         throw;
     }
     catch (SqlException)
     {
         throw;
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #11
0
 public void HotelAccessorGetFail()
 {
     List <HotelGuest> guest = HotelGuestAccessor.HotelGuestGet(-1);
 }