public void NotificationCanceled() { // Schedule a notifiaction. var notificationId = _schedulerToTest.Create("Test Notification", "Test notification message.", DateTime.Now.AddHours(1)); // Cancel it. _schedulerToTest.Cancel(notificationId); // Try to find it. Shouldn't find it because it has been cancelled. Assert.That(() => _schedulerToTest.Find(notificationId), Is.Null); }
/// <summary> /// Cancels an existing notification. /// </summary> private void CancelNotification() { try { _notificationScheduler.Cancel(Id); var canceledTime = DateTime.Now; ScheduledNotificationRepository.NotificationCancled(Id, canceledTime); CanceledOn = canceledTime.ToString("G"); } catch (Exception ex) { Application.Current.MainPage.DisplayAlert("Error Trying to Cancel Notification", $"{ex.Message}", "OK"); } }