Example #1
0
        public async Task <List <UserNotification> > GetUserNotificationsAsync(UserIdentifier user, UserNotificationState?state = null, int skipCount = 0, int maxResultCount = int.MaxValue, DateTime?startDate = null, DateTime?endDate = null)
        {
            var userNotifications = await _store.GetUserNotificationsWithNotificationsAsync(user, state, skipCount, maxResultCount, startDate, endDate);

            return(userNotifications
                   .Select(un => un.ToUserNotification())
                   .ToList());
        }
Example #2
0
        public async Task <List <UserNotification> > GetUserNotificationsAsync(long userId, UserNotificationState?state = null, int skipCount = 0, int maxResultCount = int.MaxValue)
        {
            var userNotifications = await _store.GetUserNotificationsWithNotificationsAsync(userId, state, skipCount, maxResultCount);

            return(userNotifications
                   .Select(un => un.ToUserNotification())
                   .ToList());
        }
Example #3
0
        public async Task Should_Get_All_Notifications()
        {
            var userIdentifier = AbpSession.ToUserIdentifier();

            await _notificationPublisher.PublishAsync("Test", userIds : new[] { userIdentifier });

            var allNotifications = await
                                   _notificationStore.GetUserNotificationsWithNotificationsAsync(userIdentifier);

            allNotifications.Count.ShouldBe(1);
        }