Ejemplo n.º 1
0
        public async Task MessageCount_Send_One_Count_Changes()
        {
            long count1;

            try
            {
                count1 = await _msg.GetMessageCountAsync(_qn + _receiveChannelSuffix);
            }
            catch (NotSupportedException)
            {
                return;
            }

            await _msg.SendAsync(_qn, QueueMessage.FromText("bla bla"));

            long count2 = await _msg.GetMessageCountAsync(_qn + _receiveChannelSuffix);

            Assert.NotEqual(count1, count2);
        }
Ejemplo n.º 2
0
        public async Task RefreshAsync()
        {
            MessageCount = await _messenger.GetMessageCountAsync(ChannelName);

            IReadOnlyCollection <QueueMessage> messages = null;

            try
            {
                messages = await _messenger.PeekAsync(ChannelName, 32);
            }
            catch (Exception ex)
            {
            }

            PeekedMessages.Clear();
            foreach (QueueMessage msg in messages)
            {
                PeekedMessages.Add(msg);
            }
        }