< Summary

Class:Azure.Messaging.ServiceBus.ServiceBusSessionReceiverOptions
Assembly:Azure.Messaging.ServiceBus
File(s):C:\Git\azure-sdk-for-net\sdk\servicebus\Azure.Messaging.ServiceBus\src\Receiver\ServiceBusSessionReceiverOptions.cs
Covered lines:6
Uncovered lines:8
Coverable lines:14
Total lines:80
Line coverage:42.8% (6 of 14)
Covered branches:0
Total branches:0

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\servicebus\Azure.Messaging.ServiceBus\src\Receiver\ServiceBusSessionReceiverOptions.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="ServiceBusSessionReceiver"/>
 11    /// to configure its behavior.
 12    /// </summary>
 13    public class ServiceBusSessionReceiverOptions
 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            {
 1424                return _prefetchCount;
 25            }
 26            set
 27            {
 028                Argument.AssertAtLeast(value, 0, nameof(PrefetchCount));
 029                _prefetchCount = value;
 030            }
 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>
 037        public ReceiveMode ReceiveMode { get; set; } = ReceiveMode.PeekLock;
 38
 39        /// <summary>
 40        /// An optional session ID to scope the <see cref="ServiceBusSessionReceiver"/> to. If left blank,
 41        /// the next available session returned from the service will be used.
 42        /// </summary>
 043        public string SessionId { get; set; }
 44
 45        /// <summary>
 46        /// Determines whether the specified <see cref="System.Object" /> is equal to this instance.
 47        /// </summary>
 48        ///
 49        /// <param name="obj">The <see cref="System.Object" /> to compare with this instance.</param>
 50        ///
 51        /// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>
 52        [EditorBrowsable(EditorBrowsableState.Never)]
 053        public override bool Equals(object obj) => base.Equals(obj);
 54
 55        /// <summary>
 56        /// Returns a hash code for this instance.
 57        /// </summary>
 58        ///
 59        /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a ha
 60        ///
 61        [EditorBrowsable(EditorBrowsableState.Never)]
 062        public override int GetHashCode() => base.GetHashCode();
 63
 64        /// <summary>
 65        /// Converts the instance to string representation.
 66        /// </summary>
 67        ///
 68        /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
 69        ///
 70        [EditorBrowsable(EditorBrowsableState.Never)]
 071        public override string ToString() => base.ToString();
 72
 73        internal ServiceBusReceiverOptions ToReceiverOptions() =>
 1474            new ServiceBusReceiverOptions()
 1475            {
 1476                ReceiveMode = ReceiveMode,
 1477                PrefetchCount = PrefetchCount
 1478            };
 79    }
 80}