< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_IsDirectory()-100%100%
get_Name()-100%100%
get_FileSize()-0%100%
.ctor(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Models\ShareFileItem.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4#pragma warning disable SA1402  // File may only contain a single type
 5
 6namespace Azure.Storage.Files.Shares.Models
 7{
 8    /// <summary>
 9    /// Describes a file or directory returned by
 10    /// <see cref="ShareDirectoryClient.GetFilesAndDirectoriesAsync"/>.
 11    /// </summary>
 12    public class ShareFileItem
 13    {
 14        /// <summary>
 15        /// Gets a value indicating whether this item is a directory.
 16        /// </summary>
 6017        public bool IsDirectory { get; }
 18
 19        /// <summary>
 20        /// Gets the name of this item.
 21        /// </summary>
 8022        public string Name { get; }
 23
 24        /// <summary>
 25        /// Gets an optional value indicating the file size, if this item is
 26        /// a file.
 27        /// </summary>
 028        public long? FileSize { get; }
 29
 8030        internal ShareFileItem(bool isDirectory, string name, long? fileSize = null)
 31        {
 8032            IsDirectory = isDirectory;
 8033            Name = name;
 8034            FileSize = fileSize;
 8035        }
 36    }
 37
 38    /// <summary>
 39    /// FilesModelFactory provides utilities for mocking.
 40    /// </summary>
 41    public static partial class FilesModelFactory
 42    {
 43        /// <summary>
 44        /// Creates a new StorageFileItem instance for mocking.
 45        /// </summary>
 46        public static ShareFileItem StorageFileItem(
 47            bool isDirectory, string name, long? fileSize) =>
 48            new ShareFileItem(isDirectory, name, fileSize);
 49    }
 50}