< Summary

Class:Azure.Storage.Blobs.Models.GetBlobsByHierarchyAsyncCollection
Assembly:Azure.Storage.Blobs
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Blobs\src\Models\GetBlobsByHierarchyAsyncCollection.cs
Covered lines:29
Uncovered lines:0
Coverable lines:29
Total lines:59
Line coverage:100% (29 of 29)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
GetNextPageAsync()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Blobs\src\Models\GetBlobsByHierarchyAsyncCollection.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Collections.Generic;
 5using System.Linq;
 6using System.Threading;
 7using System.Threading.Tasks;
 8using Azure.Core.Pipeline;
 9
 10namespace Azure.Storage.Blobs.Models
 11{
 12    internal class GetBlobsByHierarchyAsyncCollection : StorageCollectionEnumerator<BlobHierarchyItem>
 13    {
 14        private readonly BlobContainerClient _client;
 15        private readonly BlobTraits _traits;
 16        private readonly BlobStates _states;
 17        private readonly string _delimiter;
 18        private readonly string _prefix;
 19
 42620        public GetBlobsByHierarchyAsyncCollection(
 42621            BlobContainerClient client,
 42622            string delimiter,
 42623            BlobTraits traits,
 42624            BlobStates states,
 42625            string prefix)
 26        {
 42627            _client = client;
 42628            _delimiter = delimiter;
 42629            _traits = traits;
 42630            _states = states;
 42631            _prefix = prefix;
 42632        }
 33
 34        public override async ValueTask<Page<BlobHierarchyItem>> GetNextPageAsync(
 35            string continuationToken,
 36            int? pageSizeHint,
 37            bool async,
 38            CancellationToken cancellationToken)
 39        {
 42640            Response<BlobsHierarchySegment> response = await _client.GetBlobsByHierarchyInternal(
 42641                continuationToken,
 42642                _delimiter,
 42643                _traits,
 42644                _states,
 42645                _prefix,
 42646                pageSizeHint,
 42647                async,
 42648                cancellationToken).ConfigureAwait(false);
 49
 42250            var items = new List<BlobHierarchyItem>();
 58251            items.AddRange(response.Value.BlobPrefixes.Select(p => new BlobHierarchyItem(p.Name, null)));
 1061852            items.AddRange(response.Value.BlobItems.Select(b => new BlobHierarchyItem(null, b.ToBlobItem())));
 42253            return Page<BlobHierarchyItem>.FromValues(
 42254                items.ToArray(),
 42255                response.Value.NextMarker,
 42256                response.GetRawResponse());
 42257        }
 58    }
 59}

Methods/Properties

.ctor(...)
GetNextPageAsync()