< Summary

Class:Azure.Storage.Blobs.ChangeFeed.BlobChangeFeedPageable
Assembly:Azure.Storage.Blobs.ChangeFeed
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Blobs.ChangeFeed\src\BlobChangeFeedPageable.cs
Covered lines:0
Uncovered lines:28
Coverable lines:28
Total lines:74
Line coverage:0% (0 of 28)
Covered branches:0
Total branches:6
Branch coverage:0% (0 of 6)

Metrics

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

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Collections.Generic;
 6using Azure.Core.Pipeline;
 7
 8namespace Azure.Storage.Blobs.ChangeFeed
 9{
 10    /// <summary>
 11    /// BlobChangeFeedPagable.
 12    /// </summary>
 13    internal class BlobChangeFeedPageable : Pageable<BlobChangeFeedEvent>
 14    {
 15        private readonly ChangeFeedFactory _changeFeedFactory;
 16        private readonly DateTimeOffset? _startTime;
 17        private readonly DateTimeOffset? _endTime;
 18        private readonly string _continuation;
 19
 020        internal BlobChangeFeedPageable(
 021            BlobServiceClient blobServiceClient,
 022            DateTimeOffset? startTime = default,
 023            DateTimeOffset? endTime = default)
 24        {
 025            _changeFeedFactory = new ChangeFeedFactory(blobServiceClient);
 026            _startTime = startTime;
 027            _endTime = endTime;
 028        }
 29
 030        internal BlobChangeFeedPageable(
 031            BlobServiceClient blobServiceClient,
 032            string continuation)
 33        {
 034            _changeFeedFactory = new ChangeFeedFactory(blobServiceClient);
 035            _continuation = continuation;
 036        }
 37
 38        /// <summary>
 39        /// Returns <see cref="BlobChangeFeedEvent"/>s as Pages.
 40        /// </summary>
 41        /// <param name="continuationToken">
 42        /// Throws an <see cref="ArgumentException"/>.  To use contination, call
 43        /// <see cref="BlobChangeFeedClient.GetChanges(string)"/>.
 44        /// </param>
 45        /// <param name="pageSizeHint">
 46        /// Page size.
 47        /// </param>
 48        /// <returns>
 49        /// <see cref="IEnumerable{Page}"/>.
 50        /// </returns>
 51        public override IEnumerable<Page<BlobChangeFeedEvent>> AsPages(string continuationToken = null, int? pageSizeHin
 52        {
 053            if (continuationToken != null)
 54            {
 055                throw new ArgumentException($"Continuation not supported.  Use BlobChangeFeedClient.GetChanges(string) i
 56            }
 57
 058            ChangeFeed changeFeed = _changeFeedFactory.BuildChangeFeed(
 059                _startTime,
 060                _endTime,
 061                _continuation,
 062                async: false,
 063                cancellationToken: default)
 064                .EnsureCompleted();
 65
 066            while (changeFeed.HasNext())
 67            {
 068                yield return changeFeed.GetPage(
 069                    async: false,
 070                    pageSize: pageSizeHint ?? Constants.ChangeFeed.DefaultPageSize).EnsureCompleted();
 71            }
 072        }
 73    }
 74}

Methods/Properties

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