< Summary

Class:Azure.Storage.Files.DataLake.Models.DataLakeModelFactory
Assembly:Azure.Storage.Files.DataLake
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.DataLake\src\Models\DataLakeModelFactory.cs
Covered lines:0
Uncovered lines:180
Coverable lines:180
Total lines:435
Line coverage:0% (0 of 180)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
FileDownloadDetails(...)-0%100%
FileDownloadInfo(...)-0%100%
FileSystemInfo(...)-0%100%
FileSystemItem(...)-0%100%
FileSystemProperties(...)-0%100%
Lease(...)-0%100%
PathAccessControl(...)-0%100%
PathContentInfo(...)-0%100%
PathCreateInfo(...)-0%100%
PathInfo(...)-0%100%
PathItem(...)-0%100%
PathProperties(...)-0%100%
PathProperties(...)-0%100%
UserDelegationKey(...)-0%100%
DataLakeQueryError(...)-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.DataLake\src\Models\DataLakeModelFactory.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 System.ComponentModel;
 7using System.IO;
 8
 9namespace Azure.Storage.Files.DataLake.Models
 10{
 11    /// <summary>
 12    /// DataLakeModelFactory provides utilities for mocking.
 13    /// </summary>
 14    public static partial class DataLakeModelFactory
 15    {
 16        #region FileDownloadDetails
 17        /// <summary>
 18        /// Creates a new <see cref="FileDownloadDetails"/> instance for mocking.
 19        /// </summary>
 20        public static FileDownloadDetails FileDownloadDetails(
 21            DateTimeOffset lastModified,
 22            IDictionary<string, string> metadata,
 23            string contentRange,
 24            ETag eTag,
 25            string contentEncoding,
 26            string cacheControl,
 27            string contentDisposition,
 28            string contentLanguage,
 29            DateTimeOffset copyCompletionTime,
 30            string copyStatusDescription,
 31            string copyId,
 32            string copyProgress,
 33            Uri copySource,
 34            CopyStatus copyStatus,
 35            DataLakeLeaseDuration leaseDuration,
 36            DataLakeLeaseState leaseState,
 37            DataLakeLeaseStatus leaseStatus,
 38            string acceptRanges,
 39            bool isServerEncrypted,
 40            string encryptionKeySha256,
 41            byte[] contentHash)
 042            => new FileDownloadDetails()
 043            {
 044                LastModified = lastModified,
 045                Metadata = metadata,
 046                ContentRange = contentRange,
 047                ETag = eTag,
 048                ContentEncoding = contentEncoding,
 049                CacheControl = cacheControl,
 050                ContentDisposition = contentDisposition,
 051                ContentLanguage = contentLanguage,
 052                CopyCompletedOn = copyCompletionTime,
 053                CopyStatusDescription = copyStatusDescription,
 054                CopyId = copyId,
 055                CopyProgress = copyProgress,
 056                CopySource = copySource,
 057                CopyStatus = copyStatus,
 058                LeaseDuration = leaseDuration,
 059                LeaseState = leaseState,
 060                LeaseStatus = leaseStatus,
 061                AcceptRanges = acceptRanges,
 062                IsServerEncrypted = isServerEncrypted,
 063                EncryptionKeySha256 = encryptionKeySha256,
 064                ContentHash = contentHash
 065            };
 66        #endregion FileDownloadDetails
 67
 68        #region FileDownloadInfo
 69        /// <summary>
 70        /// Creates a new <see cref="FileDownloadInfo"/> instance for mocking.
 71        /// </summary>
 72        public static FileDownloadInfo FileDownloadInfo(
 73            long contentLength,
 74            Stream content,
 75            byte[] contentHash,
 76            FileDownloadDetails properties)
 077            => new FileDownloadInfo()
 078            {
 079                ContentLength = contentLength,
 080                Content = content,
 081                ContentHash = contentHash,
 082                Properties = properties
 083            };
 84        #endregion FileDownloadInfo
 85
 86        #region FileSystemInfo
 87        /// <summary>
 88        /// Creates a new <see cref="FileSystemInfo"/> instance for mocking.
 89        /// </summary>
 90        public static FileSystemInfo FileSystemInfo(
 91            ETag etag,
 92            DateTimeOffset lastModified)
 093            => new FileSystemInfo()
 094            {
 095                ETag = etag,
 096                LastModified = lastModified
 097            };
 98        #endregion FileSystemInfo
 99
 100        #region FileSystemItem
 101        /// <summary>
 102        /// Creates a new <see cref="FileSystemItem"/> instance for mocking.
 103        /// </summary>
 104        public static FileSystemItem FileSystemItem(
 105            string name,
 106            FileSystemProperties properties)
 0107            => new FileSystemItem()
 0108            {
 0109                Name = name,
 0110                Properties = properties
 0111            };
 112        #endregion FileSystemItem
 113
 114        #region FileSystemProperties
 115        /// <summary>
 116        /// Creates a new <see cref="FileSystemProperties"/> instance for mocking.
 117        /// </summary>
 118        public static FileSystemProperties FileSystemProperties(
 119            DateTimeOffset lastModified,
 120            DataLakeLeaseStatus? leaseStatus,
 121            DataLakeLeaseState? leaseState,
 122            DataLakeLeaseDuration? leaseDuration,
 123            PublicAccessType? publicAccess,
 124            bool? hasImmutabilityPolicy,
 125            bool? hasLegalHold,
 126            ETag eTag)
 0127            => new FileSystemProperties()
 0128            {
 0129                LastModified = lastModified,
 0130                LeaseStatus = leaseStatus,
 0131                LeaseState = leaseState,
 0132                LeaseDuration = leaseDuration,
 0133                PublicAccess = publicAccess,
 0134                HasImmutabilityPolicy = hasImmutabilityPolicy,
 0135                HasLegalHold = hasLegalHold,
 0136                ETag = eTag
 0137            };
 138        #endregion FileSystemProperties
 139
 140        #region Lease
 141        /// <summary>
 142        /// Creates a new <see cref="DataLakeLease"/> instance for mocking.
 143        /// </summary>
 144        public static DataLakeLease Lease(
 145            ETag eTag,
 146            DateTimeOffset lastModified,
 147            string leaseId,
 148            int? leaseTime)
 0149            => new DataLakeLease()
 0150            {
 0151                ETag = eTag,
 0152                LastModified = lastModified,
 0153                LeaseId = leaseId,
 0154                LeaseTime = leaseTime
 0155            };
 156        #endregion Lease
 157
 158        #region PathAccessControl
 159        /// <summary>
 160        /// Creates a new <see cref="PathAccessControl"/> instance for mocking.
 161        /// </summary>
 162        public static PathAccessControl PathAccessControl(
 163            string owner,
 164            string group,
 165            PathPermissions permissions,
 166            IList<PathAccessControlItem> acl)
 0167            => new PathAccessControl()
 0168            {
 0169                Owner = owner,
 0170                Group = group,
 0171                Permissions = permissions,
 0172                AccessControlList = acl
 0173            };
 174        #endregion PathAccessControl
 175
 176        #region PathContentInfo
 177        /// <summary>
 178        /// Creates a new <see cref="PathContentInfo"/> instance for mocking.
 179        /// </summary>
 180        public static PathContentInfo PathContentInfo(
 181            string contentHash,
 182            ETag eTag,
 183            DateTimeOffset lastModified,
 184            string acceptRanges,
 185            string cacheControl,
 186            string contentDisposition,
 187            string contentEncoding,
 188            string contentLanguage,
 189            long contentLength,
 190            string contentRange,
 191            string contentType,
 192            IDictionary<string, string> metadata)
 0193            => new PathContentInfo()
 0194            {
 0195                ContentHash = contentHash,
 0196                ETag = eTag,
 0197                LastModified = lastModified,
 0198                AcceptRanges = acceptRanges,
 0199                CacheControl = cacheControl,
 0200                ContentDisposition = contentDisposition,
 0201                ContentEncoding = contentEncoding,
 0202                ContentLanguage = contentLanguage,
 0203                ContentLength = contentLength,
 0204                ContentRange = contentRange,
 0205                ContentType = contentType,
 0206                Metadata = metadata
 0207            };
 208        #endregion PathContentInfo
 209
 210        #region PathCreateInfo
 211        /// <summary>
 212        /// Creates a new <see cref="PathCreateInfo"/> instance for mocking.
 213        /// </summary>
 214        public static PathCreateInfo PathCreateInfo(
 215            PathInfo pathInfo,
 216            string continuation)
 0217            => new PathCreateInfo()
 0218            {
 0219                PathInfo = pathInfo,
 0220                Continuation = continuation
 0221            };
 222        #endregion PathCreateInfo
 223
 224        #region PathInfo
 225        /// <summary>
 226        /// Creates a new <see cref="PathInfo"/> instance for mocking.
 227        /// </summary>
 228        public static PathInfo PathInfo(
 229            ETag eTag,
 230            DateTimeOffset lastModified)
 0231            => new PathInfo()
 0232            {
 0233                ETag = eTag,
 0234                LastModified = lastModified
 0235            };
 236        #endregion PathInfo
 237
 238        #region PathItem
 239        /// <summary>
 240        /// Creates a new <see cref="PathItem"/> instance for mocking.
 241        /// </summary>
 242        public static PathItem PathItem(
 243            string name,
 244            bool? isDirectory,
 245            DateTimeOffset lastModified,
 246            ETag eTag,
 247            long? contentLength,
 248            string owner,
 249            string group,
 250            string permissions)
 0251            => new PathItem()
 0252            {
 0253                Name = name,
 0254                IsDirectory = isDirectory,
 0255                LastModified = lastModified,
 0256                ETag = eTag,
 0257                ContentLength = contentLength,
 0258                Owner = owner,
 0259                Group = group,
 0260                Permissions = permissions
 0261            };
 262        #endregion PathItem
 263
 264        #region PathProperties
 265        /// <summary>
 266        /// Creates a new PathProperties instance for mocking.
 267        /// </summary>
 268        public static PathProperties PathProperties(
 269            DateTimeOffset lastModified,
 270            DateTimeOffset creationTime,
 271            IDictionary<string, string> metadata,
 272            DateTimeOffset copyCompletionTime,
 273            string copyStatusDescription,
 274            string copyId,
 275            string copyProgress,
 276            Uri copySource,
 277            CopyStatus copyStatus,
 278            bool isIncrementalCopy,
 279            DataLakeLeaseDuration leaseDuration,
 280            DataLakeLeaseState leaseState,
 281            DataLakeLeaseStatus leaseStatus,
 282            long contentLength,
 283            string contentType,
 284            ETag eTag,
 285            byte[] contentHash,
 286            string contentEncoding,
 287            string contentDisposition,
 288            string contentLanguage,
 289            string cacheControl,
 290            string acceptRanges,
 291            bool isServerEncrypted,
 292            string encryptionKeySha256,
 293            string accessTier,
 294            string archiveStatus,
 295            DateTimeOffset accessTierChangeTime,
 296            bool isDirectory)
 0297            => new PathProperties()
 0298            {
 0299                LastModified = lastModified,
 0300                CreatedOn = creationTime,
 0301                Metadata = metadata,
 0302                CopyCompletedOn = copyCompletionTime,
 0303                CopyStatusDescription = copyStatusDescription,
 0304                CopyId = copyId,
 0305                CopyProgress = copyProgress,
 0306                CopySource = copySource,
 0307                CopyStatus = copyStatus,
 0308                IsIncrementalCopy = isIncrementalCopy,
 0309                LeaseDuration = leaseDuration,
 0310                LeaseState = leaseState,
 0311                LeaseStatus = leaseStatus,
 0312                ContentLength = contentLength,
 0313                ContentType = contentType,
 0314                ETag = eTag,
 0315                ContentHash = contentHash,
 0316                ContentEncoding = contentEncoding,
 0317                ContentDisposition = contentDisposition,
 0318                ContentLanguage = contentLanguage,
 0319                CacheControl = cacheControl,
 0320                AcceptRanges = acceptRanges,
 0321                IsServerEncrypted = isServerEncrypted,
 0322                EncryptionKeySha256 = encryptionKeySha256,
 0323                AccessTier = accessTier,
 0324                ArchiveStatus = archiveStatus,
 0325                AccessTierChangedOn = accessTierChangeTime,
 0326                IsDirectory = isDirectory
 0327            };
 328
 329        /// <summary>
 330        /// Creates a new PathProperties instance for mocking.
 331        /// </summary>
 332        [EditorBrowsable(EditorBrowsableState.Never)]
 333        public static PathProperties PathProperties(
 334            DateTimeOffset lastModified,
 335            DateTimeOffset creationTime,
 336            IDictionary<string, string> metadata,
 337            DateTimeOffset copyCompletionTime,
 338            string copyStatusDescription,
 339            string copyId,
 340            string copyProgress,
 341            Uri copySource,
 342            CopyStatus copyStatus,
 343            bool isIncrementalCopy,
 344            DataLakeLeaseDuration leaseDuration,
 345            DataLakeLeaseState leaseState,
 346            DataLakeLeaseStatus leaseStatus,
 347            long contentLength,
 348            string contentType,
 349            ETag eTag,
 350            byte[] contentHash,
 351            string contentEncoding,
 352            string contentDisposition,
 353            string contentLanguage,
 354            string cacheControl,
 355            string acceptRanges,
 356            bool isServerEncrypted,
 357            string encryptionKeySha256,
 358            string accessTier,
 359            string archiveStatus,
 360            DateTimeOffset accessTierChangeTime)
 0361            => new PathProperties()
 0362            {
 0363                LastModified = lastModified,
 0364                CreatedOn = creationTime,
 0365                Metadata = metadata,
 0366                CopyCompletedOn = copyCompletionTime,
 0367                CopyStatusDescription = copyStatusDescription,
 0368                CopyId = copyId,
 0369                CopyProgress = copyProgress,
 0370                CopySource = copySource,
 0371                CopyStatus = copyStatus,
 0372                IsIncrementalCopy = isIncrementalCopy,
 0373                LeaseDuration = leaseDuration,
 0374                LeaseState = leaseState,
 0375                LeaseStatus = leaseStatus,
 0376                ContentLength = contentLength,
 0377                ContentType = contentType,
 0378                ETag = eTag,
 0379                ContentHash = contentHash,
 0380                ContentEncoding = contentEncoding,
 0381                ContentDisposition = contentDisposition,
 0382                ContentLanguage = contentLanguage,
 0383                CacheControl = cacheControl,
 0384                AcceptRanges = acceptRanges,
 0385                IsServerEncrypted = isServerEncrypted,
 0386                EncryptionKeySha256 = encryptionKeySha256,
 0387                AccessTier = accessTier,
 0388                ArchiveStatus = archiveStatus,
 0389                AccessTierChangedOn = accessTierChangeTime
 0390            };
 391        #endregion PathProperties
 392
 393        #region UserDelegationKey
 394        /// <summary>
 395        /// Creates a new <see cref="UserDelegationKey"/> instance for mocking.
 396        /// </summary>
 397        public static UserDelegationKey UserDelegationKey(
 398            string signedObjectId,
 399            string signedTenantId,
 400            DateTimeOffset signedStart,
 401            DateTimeOffset signedExpiry,
 402            string signedService,
 403            string signedVersion,
 404            string value)
 0405            => new UserDelegationKey()
 0406            {
 0407                SignedObjectId = signedObjectId,
 0408                SignedTenantId = signedTenantId,
 0409                SignedStartsOn = signedStart,
 0410                SignedExpiresOn = signedExpiry,
 0411                SignedService = signedService,
 0412                SignedVersion = signedVersion,
 0413                Value = value
 0414            };
 415        #endregion UserDelegationKey
 416
 417        #region DataLakeQueryError
 418        /// <summary>
 419        /// Creates a new BlobQueryError instance for mocking.
 420        /// </summary>
 421        public static DataLakeQueryError DataLakeQueryError(
 422            string name = default,
 423            string description = default,
 424            bool isFatal = default,
 425            long position = default)
 0426            => new DataLakeQueryError
 0427            {
 0428                Name = name,
 0429                Description = description,
 0430                IsFatal = isFatal,
 0431                Position = position
 0432            };
 433        #endregion DataLakeQueryError
 434    }
 435}