< Summary

Class:Azure.Storage.Files.Shares.Models.ShareDirectoryInfo
Assembly:Azure.Storage.Files.Shares
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareDirectoryInfo.cs
Covered lines:7
Uncovered lines:0
Coverable lines:7
Total lines:74
Line coverage:100% (7 of 7)
Covered branches:0
Total branches:0

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareDirectoryInfo.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    /// Subset of the directory's properties.
 14    /// </summary>
 15    public class ShareDirectoryInfo
 16    {
 17        internal RawStorageDirectoryInfo _rawStorageDirectoryInfo;
 18
 19        /// <summary>
 20        /// The ETag contains a value which represents the version of the directory, in quotes.
 21        /// </summary>
 3422        public ETag ETag => _rawStorageDirectoryInfo.ETag;
 23
 24        /// <summary>
 25        /// Returns the date and time the directory was last modified. Any operation that modifies the directory or
 26        /// its properties updates the last modified time. Operations on files do not affect the last modified time of t
 27        /// </summary>
 1028        public DateTimeOffset LastModified => _rawStorageDirectoryInfo.LastModified;
 29
 30        /// <summary>
 31        /// The directory's SMB properties.
 32        /// </summary>
 36733        public FileSmbProperties SmbProperties { get; set; }
 34
 33935        internal ShareDirectoryInfo(RawStorageDirectoryInfo rawStorageDirectoryInfo)
 36        {
 33937            _rawStorageDirectoryInfo = rawStorageDirectoryInfo;
 33938            SmbProperties = new FileSmbProperties(rawStorageDirectoryInfo);
 33939        }
 40    }
 41
 42    /// <summary>
 43    /// FilesModelFactory provides utilities for mocking.
 44    /// </summary>
 45    public static partial class SharesModelFactory
 46    {
 47        /// <summary>
 48        /// Creates a new StorageDirectoryInfo instance for mocking.
 49        /// </summary>
 50        public static ShareDirectoryInfo StorageDirectoryInfo(
 51            ETag eTag,
 52            DateTimeOffset lastModified,
 53            string filePermissionKey,
 54            string fileAttributes,
 55            DateTimeOffset fileCreationTime,
 56            DateTimeOffset fileLastWriteTime,
 57            DateTimeOffset fileChangeTime,
 58            string fileId,
 59            string fileParentId
 60            )
 61            => new ShareDirectoryInfo(new RawStorageDirectoryInfo
 62            {
 63                ETag = eTag,
 64                LastModified = lastModified,
 65                FilePermissionKey = filePermissionKey,
 66                FileAttributes = fileAttributes,
 67                FileCreationTime = fileCreationTime,
 68                FileLastWriteTime = fileLastWriteTime,
 69                FileChangeTime = fileChangeTime,
 70                FileId = fileId,
 71                FileParentId = fileParentId
 72            });
 73    }
 74}