public void SetUp() { notification = new PeriodicEventNotification { Name = "Test notification" }; }
public void AddNotification_PassPeriodicEventNotificationWithDaysOfWeekProperty_ShouldSaveThisProperty() { var days = new List <DaysOfWeekWhenSendNotification>() { new DaysOfWeekWhenSendNotification { DayOfWeekId = 1 }, new DaysOfWeekWhenSendNotification { DayOfWeekId = 6 } }; var notification = new PeriodicEventNotification { Name = "Test name", Description = "Test description", SendingHour = 8, DaysOfWeekWhenSendNotification = days, IsActive = true }; _notificationRepository.AddNotification(notification); _notificationRepository.Save(); var result = _notificationRepository.GetNotification(notification.NotificationId) as PeriodicEventNotification; Assert.AreEqual(days.Count, result.DaysOfWeekWhenSendNotification.Count); }
public void AddNotification_PassPeriodicEventNotification_ShouldSaveThisNotification() { var notification = new PeriodicEventNotification { Name = "Test name", Description = "Test description", SendingHour = 8 }; _notificationRepository.AddNotification(notification); _notificationRepository.Save(); var result = _context.Notifications.Count(); Assert.AreEqual(1, result); }