< Summary

Class:Azure.Storage.StorageTransferOptions
Assembly:Azure.Storage.Common
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Common\src\StorageTransferOptions.cs
Covered lines:5
Uncovered lines:12
Coverable lines:17
Total lines:109
Line coverage:29.4% (5 of 17)
Covered branches:2
Total branches:14
Branch coverage:14.2% (2 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_MaximumTransferLength()-0%0%
set_MaximumTransferLength(...)-100%50%
get_MaximumTransferSize()-100%100%
get_MaximumConcurrency()-100%100%
get_InitialTransferLength()-0%0%
set_InitialTransferLength(...)-100%50%
get_InitialTransferSize()-100%100%
Equals(...)-0%0%
GetHashCode()-0%100%
op_Equality(...)-0%100%
op_Inequality(...)-0%100%
Equals(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Common\src\StorageTransferOptions.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.ComponentModel;
 6
 7namespace Azure.Storage
 8{
 9    /// <summary>
 10    /// <see cref="StorageTransferOptions"/> is used to provide options for parallel transfers.
 11    /// </summary>
 12    public struct StorageTransferOptions : IEquatable<StorageTransferOptions>
 13    {
 14        /// <summary>
 15        /// The maximum length of an transfer in bytes. This property is a backwards-compatible
 16        /// facade for <see cref="MaximumTransferSize"/>, which supports long values. Use
 17        /// <see cref="MaximumTransferSize"/> for full access of supported values.
 18        /// </summary>
 19        [EditorBrowsable(EditorBrowsableState.Never)]
 20        public int? MaximumTransferLength
 21        {
 022            get => (int?)MaximumTransferSize;
 15223            set => MaximumTransferSize = value;
 24        }
 25
 26        /// <summary>
 27        /// The maximum length of an transfer in bytes.
 28        /// </summary>
 306829        public long? MaximumTransferSize { get; set; }
 30
 31        /// <summary>
 32        /// The maximum number of workers that may be used in a parallel transfer.
 33        /// </summary>
 250034        public int? MaximumConcurrency { get; set; }
 35
 36        /// <summary>
 37        /// The size of the first range request in bytes. Blobs smaller than this limit will
 38        /// be downloaded in a single request. Blobs larger than this limit will continue being
 39        /// downloaded in chunks of size <see cref="MaximumTransferSize"/>. This property is a
 40        /// backwards-compatible facade for <see cref="MaximumTransferSize"/>, which supports
 41        /// long values. Use <see cref="InitialTransferSize"/> for full access of supported values.
 42        /// </summary>
 43        [EditorBrowsable(EditorBrowsableState.Never)]
 44        public int? InitialTransferLength
 45        {
 046            get => (int?)InitialTransferSize;
 8047            set => InitialTransferSize = value;
 48        }
 49
 50        /// <summary>
 51        /// The size of the first range request in bytes. Blobs smaller than this limit will
 52        /// be downloaded in a single request. Blobs larger than this limit will continue being
 53        /// downloaded in chunks of size <see cref="MaximumTransferSize"/>.
 54        /// </summary>
 284055        public long? InitialTransferSize { get; set; }
 56
 57        /// <summary>
 58        /// Check if two ParallelTransferOptions instances are equal.
 59        /// </summary>
 60        /// <param name="obj">The instance to compare to.</param>
 61        /// <returns>True if they're equal, false otherwise.</returns>
 62        [EditorBrowsable(EditorBrowsableState.Never)]
 63        public override bool Equals(object obj)
 064            => obj is StorageTransferOptions other
 065            && Equals(other)
 66            ;
 67
 68        /// <summary>
 69        /// Get a hash code for the ParallelTransferOptions.
 70        /// </summary>
 71        /// <returns>Hash code for the ParallelTransferOptions.</returns>
 72        [EditorBrowsable(EditorBrowsableState.Never)]
 73        public override int GetHashCode()
 074            => MaximumTransferSize.GetHashCode()
 075            ^ MaximumConcurrency.GetHashCode()
 076            ^ InitialTransferSize.GetHashCode()
 77            ;
 78
 79        /// <summary>
 80        /// Check if two ParallelTransferOptions instances are equal.
 81        /// </summary>
 82        /// <param name="left">The first instance to compare.</param>
 83        /// <param name="right">The second instance to compare.</param>
 84        /// <returns>True if they're equal, false otherwise.</returns>
 85        [EditorBrowsable(EditorBrowsableState.Never)]
 086        public static bool operator ==(StorageTransferOptions left, StorageTransferOptions right) => left.Equals(right);
 87
 88        /// <summary>
 89        /// Check if two ParallelTransferOptions instances are equal.
 90        /// </summary>
 91        /// <param name="left">The first instance to compare.</param>
 92        /// <param name="right">The second instance to compare.</param>
 93        /// <returns>True if they're not equal, false otherwise.</returns>
 94        [EditorBrowsable(EditorBrowsableState.Never)]
 095        public static bool operator !=(StorageTransferOptions left, StorageTransferOptions right) => !(left == right);
 96
 97        /// <summary>
 98        /// Check if two ParallelTransferOptions instances are equal.
 99        /// </summary>
 100        /// <param name="obj">The instance to compare to.</param>
 101        /// <returns>True if they're equal, false otherwise.</returns>
 102        [EditorBrowsable(EditorBrowsableState.Never)]
 103        public bool Equals(StorageTransferOptions obj)
 0104            => MaximumTransferSize == obj.MaximumTransferSize
 0105            && MaximumConcurrency == obj.MaximumConcurrency
 0106            && InitialTransferSize == obj.InitialTransferSize
 107            ;
 108    }
 109}