< Summary

Class:Azure.Storage.Files.Shares.Models.GetFilesAndDirectoriesAsyncCollection
Assembly:Azure.Storage.Files.Shares
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\GetFilesAndDirectoriesAsyncCollection.cs
Covered lines:20
Uncovered lines:0
Coverable lines:20
Total lines:47
Line coverage:100% (20 of 20)
Covered branches:1
Total branches:2
Branch coverage:50% (1 of 2)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\GetFilesAndDirectoriesAsyncCollection.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.Files.Shares.Models
 11{
 12    internal class GetFilesAndDirectoriesAsyncCollection : StorageCollectionEnumerator<ShareFileItem>
 13    {
 14        private readonly ShareDirectoryClient _client;
 15        private readonly string _prefix;
 16
 5417        public GetFilesAndDirectoriesAsyncCollection(
 5418            ShareDirectoryClient client,
 5419            string prefix)
 20        {
 5421            _client = client;
 5422            _prefix = prefix;
 5423        }
 24
 25        public override async ValueTask<Page<ShareFileItem>> GetNextPageAsync(
 26            string continuationToken,
 27            int? pageSizeHint,
 28            bool async,
 29            CancellationToken cancellationToken)
 30        {
 5431            Response<FilesAndDirectoriesSegment> response = await _client.GetFilesAndDirectoriesInternal(
 5432                continuationToken,
 5433                _prefix,
 5434                pageSizeHint,
 5435                async,
 5436                cancellationToken).ConfigureAwait(false);
 37
 5238            var items = new List<ShareFileItem>();
 9439            items.AddRange(response.Value.DirectoryItems.Select(d => new ShareFileItem(true, d.Name)));
 9040            items.AddRange(response.Value.FileItems.Select(f => new ShareFileItem(false, f.Name, f.Properties?.ContentLe
 5241            return Page<ShareFileItem>.FromValues(
 5242                items.ToArray(),
 5243                response.Value.NextMarker,
 5244                response.GetRawResponse());
 5245        }
 46    }
 47}

Methods/Properties

.ctor(...)
GetNextPageAsync()