< Summary

Class:Azure.Storage.Files.Shares.Models.FileSmbProperties
Assembly:Azure.Storage.Files.Shares
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\FileSmbProperties.cs
Covered lines:54
Uncovered lines:2
Coverable lines:56
Total lines:150
Line coverage:96.4% (54 of 56)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_FileAttributes()-100%100%
get_FilePermissionKey()-100%100%
get_FileCreatedOn()-100%100%
get_FileLastWrittenOn()-100%100%
get_FileChangedOn()-100%100%
get_FileId()-100%100%
get_ParentId()-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
.ctor(...)-100%100%
.ctor(...)-100%100%
.ctor(...)-100%100%
.ctor(...)-100%100%
Equals(...)-0%100%
GetHashCode()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\FileSmbProperties.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.Globalization;
 8using System.Linq;
 9using System.Text;
 10
 11#pragma warning disable SA1402 // File may only contain a single type
 12
 13namespace Azure.Storage.Files.Shares.Models
 14{
 15    /// <summary>
 16    /// The SMB properties for a file.
 17    /// </summary>
 18    public class FileSmbProperties
 19    {
 20        /// <summary>
 21        /// The file system attributes for this file.
 22        /// </summary>
 143723        public NtfsFileAttributes? FileAttributes { get; set; }
 24
 25        /// <summary>
 26        /// The key of the file permission.
 27        /// </summary>
 263328        public string FilePermissionKey { get; set; }
 29
 30        /// <summary>
 31        /// The creation time of the file.
 32        /// </summary>
 144133        public DateTimeOffset? FileCreatedOn { get; set; }
 34
 35        /// <summary>
 36        /// The last write time of the file.
 37        /// </summary>
 144138        public DateTimeOffset? FileLastWrittenOn { get; set; }
 39
 40        /// <summary>
 41        /// The change time of the file.
 42        /// </summary>
 80043        public DateTimeOffset? FileChangedOn { get; internal set; }
 44
 45        /// <summary>
 46        /// The fileId of the file.
 47        /// </summary>
 80048        public string FileId { get; internal set; }
 49
 50        /// <summary>
 51        /// The parentId of the file
 52        /// </summary>
 80053        public string ParentId { get; internal set; }
 54
 62155        internal FileSmbProperties()
 56        {
 62157        }
 58
 25459        internal FileSmbProperties(RawStorageFileInfo rawStorageFileInfo)
 60        {
 25461            FileAttributes = ShareExtensions.ToFileAttributes(rawStorageFileInfo.FileAttributes);
 25462            FilePermissionKey = rawStorageFileInfo.FilePermissionKey;
 25463            FileCreatedOn = rawStorageFileInfo.FileCreationTime;
 25464            FileLastWrittenOn = rawStorageFileInfo.FileLastWriteTime;
 25465            FileChangedOn = rawStorageFileInfo.FileChangeTime;
 25466            FileId = rawStorageFileInfo.FileId;
 25467            ParentId = rawStorageFileInfo.FileParentId;
 68
 25469        }
 70
 7471        internal FileSmbProperties(RawStorageFileProperties rawStorageFileProperties)
 72        {
 7473            FileAttributes = ShareExtensions.ToFileAttributes(rawStorageFileProperties.FileAttributes);
 7474            FilePermissionKey = rawStorageFileProperties.FilePermissionKey;
 7475            FileCreatedOn = rawStorageFileProperties.FileCreationTime;
 7476            FileLastWrittenOn = rawStorageFileProperties.FileLastWriteTime;
 7477            FileChangedOn = rawStorageFileProperties.FileChangeTime;
 7478            FileId = rawStorageFileProperties.FileId;
 7479            ParentId = rawStorageFileProperties.FileParentId;
 7480        }
 81
 6182        internal FileSmbProperties(FlattenedStorageFileProperties flattenedStorageFileProperties)
 83        {
 6184            FileAttributes = ShareExtensions.ToFileAttributes(flattenedStorageFileProperties.FileAttributes);
 6185            FilePermissionKey = flattenedStorageFileProperties.FilePermissionKey;
 6186            FileCreatedOn = flattenedStorageFileProperties.FileCreationTime;
 6187            FileLastWrittenOn = flattenedStorageFileProperties.FileLastWriteTime;
 6188            FileChangedOn = flattenedStorageFileProperties.FileChangeTime;
 6189            FileId = flattenedStorageFileProperties.FileId;
 6190            ParentId = flattenedStorageFileProperties.FileParentId;
 6191        }
 92
 33993        internal FileSmbProperties(RawStorageDirectoryInfo rawStorageDirectoryInfo)
 94        {
 33995            FileAttributes = ShareExtensions.ToFileAttributes(rawStorageDirectoryInfo.FileAttributes);
 33996            FilePermissionKey = rawStorageDirectoryInfo.FilePermissionKey;
 33997            FileCreatedOn = rawStorageDirectoryInfo.FileCreationTime;
 33998            FileLastWrittenOn = rawStorageDirectoryInfo.FileLastWriteTime;
 33999            FileChangedOn = rawStorageDirectoryInfo.FileChangeTime;
 339100            FileId = rawStorageDirectoryInfo.FileId;
 339101            ParentId = rawStorageDirectoryInfo.FileParentId;
 339102        }
 103
 40104        internal FileSmbProperties(RawStorageDirectoryProperties rawStorageDirectoryProperties)
 105        {
 40106            FileAttributes = ShareExtensions.ToFileAttributes(rawStorageDirectoryProperties.FileAttributes);
 40107            FilePermissionKey = rawStorageDirectoryProperties.FilePermissionKey;
 40108            FileCreatedOn = rawStorageDirectoryProperties.FileCreationTime;
 40109            FileLastWrittenOn = rawStorageDirectoryProperties.FileLastWriteTime;
 40110            FileChangedOn = rawStorageDirectoryProperties.FileChangeTime;
 40111            FileId = rawStorageDirectoryProperties.FileId;
 40112            ParentId = rawStorageDirectoryProperties.FileParentId;
 40113        }
 114
 115        /// <summary>
 116        /// Checks if two FileSmbProperties are equal.
 117        /// </summary>
 118        /// <param name="other">The other instance to compare to.</param>
 119        /// <returns></returns>
 120        [EditorBrowsable(EditorBrowsableState.Never)]
 121        public override bool Equals(object other)
 0122            => base.Equals(other);
 123
 124        /// <summary>
 125        /// Gets the hash code for the FileSmbProperties.
 126        /// </summary>
 127        /// <returns></returns>
 128        [EditorBrowsable(EditorBrowsableState.Never)]
 0129        public override int GetHashCode() => base.GetHashCode();
 130    }
 131
 132     /// <summary>
 133     /// FilesModelFactory provides utilities for mocking.
 134     /// </summary>
 135    public static partial class SharesModelFactory
 136    {
 137        /// <summary>
 138        /// Creates a new FileSmbProperties instance for mocking.
 139        /// </summary>
 140        public static FileSmbProperties FileSmbProperties(
 141            DateTimeOffset? fileChangedOn,
 142            string fileId,
 143            string parentId) => new FileSmbProperties
 144            {
 145                FileChangedOn = fileChangedOn,
 146                FileId = fileId,
 147                ParentId = parentId
 148            };
 149    }
 150}