コード例 #1
0
 public void SetUp()
 {
     notification = new PeriodicEventNotification
     {
         Name = "Test notification"
     };
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }