public void TestDeactivateGuestValid() { //Arrange int validGuestID = _guests[0].GuestID; //Act _guestManager.DeactivateGuest(validGuestID); //Assert Assert.IsFalse(_guestManager.ReadGuestByGuestID(validGuestID).Active); }
/// <summary> /// Alisa Roehr /// Created: 2019/03/01 /// /// for activating and deactivating guests. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnActivateGuest_Click(object sender, RoutedEventArgs e) { try { if (dgGuests.SelectedItem != null) { Guest guest = _guestManager.ReadGuestByGuestID(((Guest)dgGuests.SelectedItem).GuestID); if (guest.Active == true) { _guestManager.DeactivateGuest(guest.GuestID); } else if (guest.Active == false) { _guestManager.ReactivateGuest(guest.GuestID); } _guests = _guestManager.ReadAllGuests(); dgGuests.ItemsSource = _guests; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Activating or Deactivating Guest Failed!"); } }