< Summary

Class:Azure.Messaging.EventHubs.Processor.PartitionInitializingEventArgs
Assembly:Azure.Messaging.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.Messaging.EventHubs\src\Processor\PartitionInitializingEventArgs.cs
Covered lines:0
Uncovered lines:11
Coverable lines:11
Total lines:59
Line coverage:0% (0 of 11)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_PartitionId()-0%100%
get_DefaultStartingPosition()-0%100%
get_CancellationToken()-0%100%
.ctor(...)-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.Messaging.EventHubs\src\Processor\PartitionInitializingEventArgs.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Threading;
 5using Azure.Core;
 6using Azure.Messaging.EventHubs.Consumer;
 7
 8namespace Azure.Messaging.EventHubs.Processor
 9{
 10    /// <summary>
 11    ///   Contains information about a partition that an <c>EventProcessorClient</c> will be
 12    ///   processing events from.  It can also be used to specify the position within a partition
 13    ///   where the associated <c>EventProcessorClient</c> should begin reading events in case
 14    ///   it cannot find a checkpoint.
 15    /// </summary>
 16    ///
 17    /// <seealso href="https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor" />
 18    ///
 19    public class PartitionInitializingEventArgs
 20    {
 21        /// <summary>
 22        ///   The identifier of the partition whose processing is starting.
 23        /// </summary>
 24        ///
 025        public string PartitionId { get; }
 26
 27        /// <summary>
 28        ///   The position within a partition where the associated <c>EventProcessorClient</c> should
 29        ///   begin reading events when no checkpoint can be found.
 30        /// </summary>
 31        ///
 032        public EventPosition DefaultStartingPosition { get; set; }
 33
 34        /// <summary>
 35        ///   A <see cref="CancellationToken"/> instance to signal the request to cancel the operation.
 36        /// </summary>
 37        ///
 038        public CancellationToken CancellationToken { get; }
 39
 40        /// <summary>
 41        ///   Initializes a new instance of the <see cref="PartitionInitializingEventArgs"/> class.
 42        /// </summary>
 43        ///
 44        /// <param name="partitionId">The identifier of the partition whose processing is starting.</param>
 45        /// <param name="defaultStartingPosition">The position within a partition where the associated <c>EventProcessor
 46        /// <param name="cancellationToken">A <see cref="CancellationToken"/> instance to signal the request to cancel t
 47        ///
 048        public PartitionInitializingEventArgs(string partitionId,
 049                                              EventPosition defaultStartingPosition,
 050                                              CancellationToken cancellationToken = default)
 51        {
 052            Argument.AssertNotNullOrEmpty(partitionId, nameof(partitionId));
 53
 054            PartitionId = partitionId;
 055            DefaultStartingPosition = defaultStartingPosition;
 056            CancellationToken = cancellationToken;
 057        }
 58    }
 59}