Пример #1
0
        public async Task <DisposingQueue> GetTestQueueAsync(QueueServiceClient service = default, IDictionary <string, string> metadata = default)
        {
            service ??= GetServiceClient_SharedKey();
            metadata ??= new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
            QueueClient queue = InstrumentClient(service.GetQueueClient(GetNewQueueName()));

            return(await DisposingQueue.CreateAsync(queue, metadata));
        }
        public static async Task <DisposingQueue> GetTestQueueAsync(
            this QueuesClientBuilder clientBuilder,
            QueueServiceClient service            = default,
            IDictionary <string, string> metadata = default)
        {
            service ??= clientBuilder.GetServiceClient_SharedKey();
            metadata ??= new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
            QueueClient queue = clientBuilder.AzureCoreRecordedTestBase.InstrumentClient(service.GetQueueClient(clientBuilder.GetNewQueueName()));

            return(await DisposingQueue.CreateAsync(queue, metadata));
        }
        public IDisposable GetNewQueue(out QueueClient queue, QueueServiceClient service = default, IDictionary <string, string> metadata = default)
        {
            var containerName = this.GetNewQueueName();

            service = service ?? this.GetServiceClient_SharedKey();
            var result = new DisposingQueue(
                this.InstrumentClient(service.GetQueueClient(containerName)),
                metadata ?? new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase));

            queue = this.InstrumentClient(result.QueueClient);
            return(result);
        }