コード例 #1
0
        public void StrugglingRead()
        {
            var strugglingReadEvent = new NotificationReadEvent <LearnerSkillStatusNotification>();
            var strugglingReadDate  = _strugglingDate.AddMinutes(1);

            strugglingReadEvent.EventDate = strugglingReadDate;

            _notificationEvents.Add(strugglingReadEvent);

            ProcessEventsOnNotification(_notificationEvents.Where(e => e.EventDate <= strugglingReadDate), _notificationToBuild);

            Assert.That(_notificationToBuild.IsRead);
            Assert.AreEqual(_notificationToBuild.NotificationDate, strugglingReadDate);
        }
コード例 #2
0
        public void ActivityReadResetOnApproval()
        {
            var readEvent     = new NotificationReadEvent <ActivitySubmittedNotification>();
            var readEventDate = _activitySubmittedDate.AddMinutes(1);

            readEvent.EventDate = readEventDate;

            _activitySubmittedEvents.Add(readEvent);

            ProcessEventsOnNotification(_activitySubmittedEvents.Where(e => e.EventDate <= readEventDate), _notificationToUpdate);

            Assert.True(_notificationToUpdate.IsRead);

            ProcessEventsOnNotification(_activitySubmittedEvents.Where(e => e.EventDate <= _activityApprovedDate), _notificationToUpdate);

            Assert.False(_notificationToUpdate.IsRead);
        }
コード例 #3
0
        public void NewEventsResetRead()
        {
            var strugglingReadEvent = new NotificationReadEvent <LearnerSkillStatusNotification>();
            var strugglingReadDate  = _strugglingDate.AddMinutes(1);

            strugglingReadEvent.EventDate = strugglingReadDate;

            _notificationEvents.Add(strugglingReadEvent);

            ProcessEventsOnNotification(_notificationEvents.Where(e => e.EventDate <= strugglingReadDate), _notificationToBuild);

            Assert.IsTrue(_notificationToBuild.IsRead);

            //events up to failed Once
            ProcessEventsOnNotification(_notificationEvents.Where(e => e.EventDate <= _failedOnceDate), _notificationToBuild);

            Assert.IsFalse(_notificationToBuild.IsRead);
            Assert.AreEqual(_notificationToBuild.NotificationDate, _failedOnceDate);
        }