public void TestCheckOutGuestValid()
        {
            //Arrange
            int validGuestID = _guests[0].GuestID;

            //Act
            _guestManager.CheckOutGuest(validGuestID);
            //Assert
            Assert.IsFalse(_guestManager.ReadGuestByGuestID(validGuestID).CheckedIn);
        }
예제 #2
0
 /// <summary>
 /// Alisa Roehr
 /// Created: 2019/03/01
 ///
 /// for checking in and out guests.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCheckGuest_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (dgGuests.SelectedItem != null)
         {
             Guest guest = _guestManager.ReadGuestByGuestID(((Guest)dgGuests.SelectedItem).GuestID);
             if (guest.CheckedIn == false)
             {
                 _guestManager.CheckInGuest(guest.GuestID);
             }
             else if (guest.CheckedIn == true)
             {
                 _guestManager.CheckOutGuest(guest.GuestID);
             }
             _guests = _guestManager.ReadAllGuests();
             dgGuests.ItemsSource = _guests;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Checking In or Out Guest Failed!");
     }
 }