public void SetUp() { notification = new HistoricEventNotification { Name = "Test notification" }; }
public void AddNotification_PassHistoricEventNotification_ShouldSaveThisNotification() { var notification = new HistoricEventNotification { Name = "Test name", Description = "Test description", SendingHour = 8 }; _notificationRepository.AddNotification(notification); _notificationRepository.Save(); var result = _context.Notifications.Count(); Assert.AreEqual(1, result); }
public void AddNotification_PassHistoricEventNotificationWithHistoricDateProperty_ShouldSaveThisProperty() { DateTime pastDate = DateTime.Now.AddDays(-3); var notification = new HistoricEventNotification { Name = "Test name", Description = "Test description", SendingHour = 8, HistoricEventDate = pastDate, IsActive = true }; _notificationRepository.AddNotification(notification); _notificationRepository.Save(); var result = _notificationRepository.GetNotification(notification.NotificationId) as HistoricEventNotification; Assert.AreEqual(pastDate, result.HistoricEventDate); }