< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_ETag()-100%100%
get_LastModified()-100%100%
get_IsServerEncrypted()-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\ShareFileInfo.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 file's properties.
 14    /// </summary>
 15    public class ShareFileInfo
 16    {
 17        /// <summary>
 18        /// The internal RawStorageFileInfo.
 19        /// </summary>
 20        internal RawStorageFileInfo _rawStorageFileInfo;
 21
 22        /// <summary>
 23        /// The ETag contains a value which represents the version of the file, in quotes.
 24        /// </summary>
 3425        public ETag ETag => _rawStorageFileInfo.ETag;
 26
 27        /// <summary>
 28        /// Returns the date and time the file was last modified.
 29        /// </summary>
 1430        public DateTimeOffset LastModified => _rawStorageFileInfo.LastModified;
 31
 32        /// <summary>
 33        /// The value of this header is set to true if the contents of the request are successfully encrypted using the 
 34        /// </summary>
 1435        public bool IsServerEncrypted => _rawStorageFileInfo.IsServerEncrypted;
 36
 37        /// <summary>
 38        /// The file's SMB properties.
 39        /// </summary>
 29240        public FileSmbProperties SmbProperties { get; set; }
 41
 25442        internal ShareFileInfo(RawStorageFileInfo rawStorageFileInfo)
 43        {
 25444            _rawStorageFileInfo = rawStorageFileInfo;
 25445            SmbProperties = new FileSmbProperties(rawStorageFileInfo);
 25446        }
 47    }
 48
 49    /// <summary>
 50    /// FilesModelFactory provides utilities for mocking.
 51    /// </summary>
 52    public static partial class FilesModelFactory
 53    {
 54        /// <summary>
 55        /// Creates a new StorageFileInfo instance for mocking.
 56        /// </summary>
 57        public static ShareFileInfo StorageFileInfo(
 58            ETag eTag,
 59            DateTimeOffset lastModified,
 60            bool isServerEncrypted,
 61            string filePermissionKey,
 62            string fileAttributes,
 63            DateTimeOffset fileCreationTime,
 64            DateTimeOffset fileLastWriteTime,
 65            DateTimeOffset fileChangeTime,
 66            string fileId,
 67            string fileParentId
 68            )
 69            => new ShareFileInfo(new RawStorageFileInfo()
 70            {
 71                ETag = eTag,
 72                LastModified = lastModified,
 73                IsServerEncrypted = isServerEncrypted,
 74                FilePermissionKey = filePermissionKey,
 75                FileAttributes = fileAttributes,
 76                FileCreationTime = fileCreationTime,
 77                FileLastWriteTime = fileLastWriteTime,
 78                FileChangeTime = fileChangeTime,
 79                FileId = fileId,
 80                FileParentId = fileParentId
 81            });
 82    }
 83}