public async Task SimpleClearQueueHistoryTestApi()
        {
            var context = _workContext.WithTag(_tag);

            AgentContractV1 agent = await _utility.SetupAgentAndQueue(_queueName, _agentName);

            EnqueueMessageContractV1 message = _utility.CreateMessage(context, agent.AgentId, _queueName);

            RestResponse <EnqueuedContractV1> response = await _client.Message.EnqueueMessage(context, message);

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

            await _client.Management.ClearQueue(context, _queueName, true);

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

            HistoryContractV1 history = (await _client.History.GetHistory(context, response.Value.MessageId)).Value;

            history.Should().NotBeNull();
        }
Beispiel #2
0
 public void VerifyHistoryMessage(
     MessageContractV1 readMessage,
     HistoryContractV1 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);
 }