public void Check_That_SendReadyReminders_Method_Turns_Ready_Status_Into_Failed_If_Sending_Failed() { var reminderStorage = new ReminderStorage(); var reminderDomain = new ReminderDomain(reminderStorage); var reminderModel = new AddReminderModel() { Date = DateTimeOffset.Now }; reminderDomain.SendReminder += r => { throw new Exception(); }; reminderDomain.Add(reminderModel); reminderDomain.CheckAwaitingReminders(null); reminderDomain.SendReadyReminders(null); var status = reminderStorage.Get(1)[0].Status; Assert.AreEqual( Storage.Core.ReminderItemStatus.Failed, status); }
public void Check_That_CheckAwaitingReminders_Method_Turns_Awaiting_Status_Into_Ready() { var reminderStorage = new ReminderStorage(); var reminderDomain = new ReminderDomain(reminderStorage); var reminderModel = new AddReminderModel() { Date = DateTimeOffset.Now }; reminderDomain.Add(reminderModel); reminderDomain.CheckAwaitingReminders(null); var status = reminderStorage.Get(1)[0].Status; Assert.AreEqual( Storage.Core.ReminderItemStatus.Ready, status); }