public void TestFosterAppointmentManagerCancelAppointment() { manager.ScheduleFosterAppointment(new FosterAppointment() { FosterAppointmentID = 25 }); bool result = manager.CancelFosterAppointment(25); Assert.IsTrue(result); Assert.IsNull(manager.ViewFosterAppointments() .Find(x => x.FosterAppointmentID == 25)); }
/// <summary> /// Creator: Timothy Lickteig /// Created: 04/27/2020 /// Approver: Zoey McDonald /// /// Event handler for the delete button /// </summary> /// <remarks> /// Updater: N/A /// Updated: N/A /// Update: N/A /// </remarks> private void BtnDelete_Click(object sender, RoutedEventArgs e) { if (null != dgAppointmentList.SelectedItem) { try { manager.CancelFosterAppointment( ((FosterAppointment)dgAppointmentList.SelectedItem).FosterAppointmentID); refreshList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }