< Summary

Class:Azure.Storage.Blobs.ChangeFeed.BlobChangeFeedAsyncPageable
Assembly:Azure.Storage.Blobs.ChangeFeed
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Blobs.ChangeFeed\src\BlobChangeFeedAsyncPageable.cs
Covered lines:27
Uncovered lines:1
Coverable lines:28
Total lines:78
Line coverage:96.4% (27 of 28)
Covered branches:13
Total branches:17
Branch coverage:76.4% (13 of 17)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
.ctor(...)-100%100%
AsPages()-92.86%76.47%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Collections.Generic;
 6
 7namespace Azure.Storage.Blobs.ChangeFeed
 8{
 9    /// <summary>
 10    /// BlobChangeFeedPagableAsync.
 11    /// </summary>
 12    internal class BlobChangeFeedAsyncPageable : AsyncPageable<BlobChangeFeedEvent>
 13    {
 14        private readonly ChangeFeedFactory _changeFeedFactory;
 15        private readonly DateTimeOffset? _startTime;
 16        private readonly DateTimeOffset? _endTime;
 17        private readonly string _continuation;
 18
 19        /// <summary>
 20        /// Internal constructor.
 21        /// </summary>
 4422        internal BlobChangeFeedAsyncPageable(
 4423            BlobServiceClient blobServiceClient,
 4424            DateTimeOffset? startTime = default,
 4425            DateTimeOffset? endTime = default)
 26        {
 4427            _changeFeedFactory = new ChangeFeedFactory(blobServiceClient);
 4428            _startTime = startTime;
 4429            _endTime = endTime;
 4430        }
 31
 3232        internal BlobChangeFeedAsyncPageable(
 3233            BlobServiceClient blobServiceClient,
 3234            string continuation)
 35        {
 3236            _changeFeedFactory = new ChangeFeedFactory(blobServiceClient);
 3237            _continuation = continuation;
 3238        }
 39
 40        /// <summary>
 41        /// Returns <see cref="BlobChangeFeedEvent"/>s as Pages.
 42        /// </summary>
 43        /// <param name="continuationToken">
 44        /// Throws an <see cref="ArgumentException"/>.  To use contination, call
 45        /// <see cref="BlobChangeFeedClient.GetChangesAsync(string)"/>.
 46        /// </param>
 47        /// <param name="pageSizeHint">
 48        /// Page size.
 49        /// </param>
 50        /// <returns>
 51        /// <see cref="IAsyncEnumerable{Page}"/>.
 52        /// </returns>
 53        public override async IAsyncEnumerable<Page<BlobChangeFeedEvent>> AsPages(
 54            string continuationToken = null,
 55            int? pageSizeHint = null)
 56        {
 7657            if (continuationToken != null)
 58            {
 059                throw new ArgumentException($"{nameof(continuationToken)} not supported.  Use BlobChangeFeedClient.GetCh
 60            }
 61
 7662            ChangeFeed changeFeed = await _changeFeedFactory.BuildChangeFeed(
 7663                _startTime,
 7664                _endTime,
 7665                _continuation,
 7666                async: true,
 7667                cancellationToken: default)
 7668                .ConfigureAwait(false);
 69
 18070            while (changeFeed.HasNext())
 71            {
 13272                yield return await changeFeed.GetPage(
 13273                    async: true,
 13274                    pageSize: pageSizeHint ?? Constants.ChangeFeed.DefaultPageSize).ConfigureAwait(false);
 75            }
 7676        }
 77    }
 78}

Methods/Properties

.ctor(...)
.ctor(...)
AsPages()