< Summary

Class:Azure.Storage.Files.Shares.Models.ShareDirectoryProperties
Assembly:Azure.Storage.Files.Shares
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareDirectoryProperties.cs
Covered lines:8
Uncovered lines:1
Coverable lines:9
Total lines:92
Line coverage:88.8% (8 of 9)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_Metadata()-100%100%
get_ETag()-100%100%
get_LastModified()-100%100%
get_IsServerEncrypted()-0%100%
get_SmbProperties()-100%100%
.ctor(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareDirectoryProperties.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.Text;
 7
 8#pragma warning disable SA1402  // File may only contain a single type
 9
 10namespace Azure.Storage.Files.Shares.Models
 11{
 12    /// <summary>
 13    /// Properites for a directory.
 14    /// </summary>
 15    public class ShareDirectoryProperties
 16    {
 17        /// <summary>
 18        /// The internal RawStorageDirectoryProperties
 19        /// </summary>
 20        internal RawStorageDirectoryProperties _rawStorageDirectoryProperties;
 21
 22        /// <summary>
 23        /// A set of name-value pairs that contain metadata for the directory.
 24        /// </summary>
 425        public IDictionary<string, string> Metadata => _rawStorageDirectoryProperties.Metadata;
 26
 27        /// <summary>
 28        /// The ETag contains a value that you can use to perform operations conditionally, in quotes.
 29        /// </summary>
 2830        public ETag ETag => _rawStorageDirectoryProperties.ETag;
 31
 32        /// <summary>
 33        /// Returns DateTimeOffest the directory was last modified. Operations on files within the directory
 34        /// do not affect the last modified time of the directory.
 35        /// </summary>
 236        public DateTimeOffset LastModified => _rawStorageDirectoryProperties.LastModified;
 37
 38        /// <summary>
 39        /// Set to true if the directory metadata is completely encrypted using the specified algorithm.
 40        /// Otherwise, the value is set to false.
 41        /// </summary>
 042        public bool IsServerEncrypted => _rawStorageDirectoryProperties.IsServerEncrypted;
 43
 44        /// <summary>
 45        /// The SMB properties for the directory.
 46        /// </summary>
 4247        public FileSmbProperties SmbProperties { get; set; }
 48
 4049        internal ShareDirectoryProperties(RawStorageDirectoryProperties rawStorageDirectoryProperties)
 50        {
 4051            _rawStorageDirectoryProperties = rawStorageDirectoryProperties;
 4052            SmbProperties = new FileSmbProperties(rawStorageDirectoryProperties);
 4053        }
 54    }
 55
 56    /// <summary>
 57    /// FilesModelFactory provides utilities for mocking.
 58    /// </summary>
 59    public static partial class FilesModelFactory
 60    {
 61        /// <summary>
 62        /// Creates a new StorageDirectoryProperties instance for mocking.
 63        /// </summary>
 64        public static ShareDirectoryProperties StorageDirectoryProperties(
 65                IDictionary<string, string> metadata,
 66                ETag eTag,
 67                DateTimeOffset lastModified,
 68                bool isServerEncrypted,
 69                string fileAttributes,
 70                DateTimeOffset fileCreationTime,
 71                DateTimeOffset fileLastWriteTime,
 72                DateTimeOffset fileChangeTime,
 73                string filePermissionKey,
 74                string fileId,
 75                string fileParentId
 76            )
 77            => new ShareDirectoryProperties(new RawStorageDirectoryProperties()
 78            {
 79                Metadata = metadata,
 80                ETag = eTag,
 81                LastModified = lastModified,
 82                IsServerEncrypted = isServerEncrypted,
 83                FileAttributes = fileAttributes,
 84                FileCreationTime = fileCreationTime,
 85                FileLastWriteTime = fileLastWriteTime,
 86                FileChangeTime = fileChangeTime,
 87                FilePermissionKey = filePermissionKey,
 88                FileId = fileId,
 89                FileParentId = fileParentId
 90            });
 91    }
 92}