Exemple #1
0
        public void InvoiceAccessorArchiveGuestInvoice()
        {   //Archives the fake guest invoice
            int id     = TestCleanupAccessor.GetHotelGuest();
            int worked = access.ArchiveGuestInvoice(id);

            Assert.AreEqual(2, worked);
        }
Exemple #2
0
        public void InvoiceManagerArchiveGuestInvoice()
        {
            int            guestID  = TestCleanupAccessor.GetHotelGuest();
            ResultsArchive result   = access.ArchiveGuestInvoice(guestID);
            ResultsArchive expected = ResultsArchive.Success;

            Assert.AreEqual(expected, result);
        }
Exemple #3
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);
        }
Exemple #4
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);
        }
Exemple #5
0
        public void HotelManagerUpdate()
        {
            ResultsEdit changed = access.AddHotelGuest(TestGuest);
            //locates the fake record ID
            int guestID = TestCleanupAccessor.GetHotelGuest();
            //pulls from real manager
            HotelGuest guest = access.GetHotelGuest(guestID);
            //assigns a new value in guest2
            HotelGuest guest2 = new HotelGuest(guest.FirstName, "Individual", guest.Address1, guest.Address2, guest.CityState, guest.PhoneNumber, guest.EmailAddress, guest.Room, guest.GuestPIN, guest.Active);
            //calls to manager to complete update
            ResultsEdit edited = access.UpdateHotelGuest(guest, guest2);

            Assert.AreEqual(ResultsEdit.Success, edited);
        }
Exemple #6
0
        public void InvoiceManagerCheckArchiveInvoice()
        {
            //Grabs the fake guest ID
            int id = TestCleanupAccessor.GetHotelGuest();
            //Retrieves the invoice for the guest
            Invoice        invoice  = access.RetrieveInvoiceByGuest(id);
            InvoiceDetails invoice2 = (InvoiceDetails)invoice;
            //creates a list of BookingDetails
            List <BookingDetails> fakeBookings = new List <BookingDetails>();
            //Creates a bookingDetails object and adds a date and quantity to it.
            BookingDetails booking = new BookingDetails();
            DateTime       date    = new DateTime(2020, 05, 01);

            booking.StartDate = date;
            booking.Quantity  = 0;
            //Adds it to the list
            fakeBookings.Add(booking);
            //checks to archive
            var result = access.CheckToArchiveInvoice(invoice2, fakeBookings);

            //Asserts it will be a success
            Assert.AreEqual(ResultsArchive.OkToArchive, result);
        }