Exemplo n.º 1
0
        public async Task SimpleClearQueueHistoryTest()
        {
            var context = _workContext.WithTag(_tag);

            int agentId = await _utility.SetupAgentAndQueue(_queueName, _agentName);

            InternalEnqueueMessageV1 message = _utility.CreateMessage(context, agentId, _queueName);

            long messageId = await _message.EnqueueMessage(context, message);

            await _utility.VerifyQueue(context, _queueName, 1, 0);

            await _management.ClearQueue(context, _queueName, true);

            await _utility.VerifyQueue(context, _queueName, 0, 0);

            InternalHistoryV1 history = await _management.GetHistory(context, messageId);

            history.Should().NotBeNull();
        }
Exemplo n.º 2
0
 public void VerifyHistoryMessage(
     InternalMessageV1 readMessage,
     InternalHistoryV1 history,
     string queueName,
     string agentName,
     int retryCount        = 1,
     SettleType settleType = SettleType.Processed
     )
 {
     history.Should().NotBeNull();
     history.HistoryId.Should().BeGreaterOrEqualTo(0);
     history.MessageId.Should().Be(readMessage.MessageId);
     history.ActivityType.Should().Be(settleType.ToString());
     history.QueueName.Should().Be(queueName);
     history.Cv.Should().Be(readMessage.Cv);
     history.ClientMessageId.Should().Be(readMessage.ClientMessageId);
     history.Payload.Should().Be(readMessage.Payload);
     history.SettleByAgent.Should().Be(agentName);
     history.ErrorMesage.Should().BeNullOrEmpty();
     history.RetryCount.Should().Be(retryCount);
 }