public async Task DelayedPublish() { var connectionFactory = CreateConnectionFactory(); using (var queueClient = new RabbitMQClient(connectionFactory)) { var queueName = $"IntegratedTestQueue_{Guid.NewGuid()}"; try { await queueClient.QueueDeclareAsync(queueName); await queueClient.ExchangeDeclareAsync("delayedTargetExchange"); await queueClient.QueueBindAsync(queueName, "delayedTargetExchange", "delayedTargetRoutingKey"); await queueClient.DelayedPublishAsync("delayedTargetExchange", "delayedTargetRoutingKey", "delayedMessage", TimeSpan.FromSeconds(5)); (await queueClient.GetMessageCountAsync(queueName)).ShouldBe <uint>(0); await Task.Delay(TimeSpan.FromSeconds(5)); (await queueClient.GetMessageCountAsync(queueName)).ShouldBe <uint>(1); } finally { await queueClient.QueueDeleteAsync(queueName); } } }