< Summary

Class:Azure.Messaging.ServiceBus.ServiceBusReceiverOptions
Assembly:Azure.Messaging.ServiceBus
File(s):C:\Git\azure-sdk-for-net\sdk\servicebus\Azure.Messaging.ServiceBus\src\Receiver\ServiceBusReceiverOptions.cs
Covered lines:10
Uncovered lines:3
Coverable lines:13
Total lines:79
Line coverage:76.9% (10 of 13)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_PrefetchCount()-100%100%
set_PrefetchCount(...)-100%100%
get_ReceiveMode()-100%100%
Equals(...)-0%100%
GetHashCode()-0%100%
ToString()-0%100%
Clone()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\servicebus\Azure.Messaging.ServiceBus\src\Receiver\ServiceBusReceiverOptions.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.ComponentModel;
 5using Azure.Core;
 6
 7namespace Azure.Messaging.ServiceBus
 8{
 9    /// <summary>
 10    /// The set of options that can be specified when creating a <see cref="ServiceBusReceiver"/>
 11    /// to configure its behavior.
 12    /// </summary>
 13    public class ServiceBusReceiverOptions
 14    {
 15        /// <summary>
 16        /// The number of messages that will be eagerly requested from Queues or Subscriptions and queued locally withou
 17        /// whether the receiver is actively receiving, intended to help maximize throughput by allowing the receiver to
 18        /// from a local cache rather than waiting on a service request.
 19        /// </summary>
 20        public int PrefetchCount
 21        {
 22            get
 23            {
 11624                return _prefetchCount;
 25            }
 26            set
 27            {
 8228                Argument.AssertAtLeast(value, 0, nameof(PrefetchCount));
 8029                _prefetchCount = value;
 8030            }
 31        }
 32        private int _prefetchCount = 0;
 33
 34        /// <summary>
 35        /// The <see cref="ReceiveMode"/> used to specify how messages are received. Defaults to PeekLock mode.
 36        /// </summary>
 19437        public ReceiveMode ReceiveMode { get; set; } = ReceiveMode.PeekLock;
 38
 39        /// <summary>
 40        /// Determines whether the specified <see cref="System.Object" /> is equal to this instance.
 41        /// </summary>
 42        ///
 43        /// <param name="obj">The <see cref="System.Object" /> to compare with this instance.</param>
 44        ///
 45        /// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>
 46        [EditorBrowsable(EditorBrowsableState.Never)]
 047        public override bool Equals(object obj) => base.Equals(obj);
 48
 49        /// <summary>
 50        /// Returns a hash code for this instance.
 51        /// </summary>
 52        ///
 53        /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a ha
 54        ///
 55        [EditorBrowsable(EditorBrowsableState.Never)]
 056        public override int GetHashCode() => base.GetHashCode();
 57
 58        /// <summary>
 59        /// Converts the instance to string representation.
 60        /// </summary>
 61        ///
 62        /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
 63        ///
 64        [EditorBrowsable(EditorBrowsableState.Never)]
 065        public override string ToString() => base.ToString();
 66
 67        /// <summary>
 68        /// Creates a new copy of the current <see cref="ServiceBusReceiverOptions" />, cloning its attributes into a ne
 69        /// </summary>
 70        ///
 71        /// <returns>A new copy of <see cref="ServiceBusReceiverOptions" />.</returns>
 72        internal ServiceBusReceiverOptions Clone() =>
 5873            new ServiceBusReceiverOptions
 5874            {
 5875                ReceiveMode = ReceiveMode,
 5876                PrefetchCount = PrefetchCount
 5877            };
 78    }
 79}