public async Task GetUserPendingMessages()
        {
            var content = Guid.NewGuid();
            var user    = fillTestDbHelper.Users.Skip(1).FirstOrDefault();
            var expectedPendingMessage = await pendingMessagesService.AddUserPendingMessageAsync(user.Id, content, content);

            var actualPendingMessage = (await pendingMessagesService.GetUserPendingMessagesAsync(user.Id)).FirstOrDefault();

            Assert.True(expectedPendingMessage.Content == actualPendingMessage.Content);
        }
Beispiel #2
0
        private async void SendPendingMessagesAsync()
        {
            try
            {
                var pendingMessages = await pendingMessagesService.GetUserPendingMessagesAsync(clientConnection.UserId.Value).ConfigureAwait(false);

                await pendingMessagesService.RemovePendingMessagesAsync(pendingMessages.Select(message => message.Id)).ConfigureAwait(false);

                noticeService.SendPendingMessagesAsync(pendingMessages, clientConnection.UserId.Value);
            }
            catch (Exception ex)
            {
                Logger.WriteLog(ex);
            }
        }