< Summary - Helper.Tests

Information
Class: Configuration.Helper.FolderInfoBase
Assembly: Configuration.Helper
File(s): D:\a\NuGetPackages\NuGetPackages\src\Helper\Configuration.Helper\FolderInfo\FolderInfoBase.cs
Tag: 3_8508158812
Line coverage
100%
Covered lines: 30
Uncovered lines: 0
Coverable lines: 30
Total lines: 79
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Location()100%11100%
get_Exists()100%11100%
get_Source()100%11100%
get_FileList()100%11100%
get_FolderList()100%11100%
SortFileList()100%22100%
SortFolderList()100%22100%
.cctor()100%11100%
.ctor()100%11100%

File(s)

D:\a\NuGetPackages\NuGetPackages\src\Helper\Configuration.Helper\FolderInfo\FolderInfoBase.cs

#LineLine coverage
 1namespace Configuration.Helper;
 2
 3/// <summary>Base class for Folder Information implementations.</summary>
 4public abstract class FolderInfoBase : IFolderInfo
 5{
 6  #region IFolderInfo Implementation
 7
 8  #region Properties
 9
 10  /// <inheritdoc />
 4311  public string Location { get; protected set; }
 12
 13  /// <inheritdoc />
 2114  public virtual bool Exists { get; protected set; }
 15
 16  /// <inheritdoc />
 2117  public IOHelper.PathType Source { get; protected set; }
 18
 19  /// <inheritdoc />
 12120  public SortedList<string, string> FileList { get; }
 21
 22  /// <inheritdoc />
 2223  public SortedList<string, IFolderInfo> FolderList { get; }
 24
 25  #endregion
 26
 27  #region Methods
 28
 29  /// <inheritdoc />
 30  public string[] SortFileList()
 331  {
 332    if( FileList.Count > 0 )
 133    {
 134      string[] retValue = FileList.Keys.ToArray();
 135      Array.Sort( retValue, new AlphanumComparator() );
 136      return retValue;
 37    }
 38
 239    return Array.Empty<string>();
 340  }
 41
 42  /// <inheritdoc />
 43  public string[] SortFolderList()
 344  {
 345    if( FolderList.Count > 0 )
 146    {
 147      string[] retValue = FolderList.Keys.ToArray();
 148      Array.Sort( retValue, new AlphanumComparator() );
 149      return retValue;
 50    }
 51
 252    return Array.Empty<string>();
 353  }
 54
 55  #endregion
 56
 57  #endregion
 58
 59  #region Default Constructor and Variables
 60
 61  /// <summary>Disk folder name separator.</summary>
 162  protected static readonly string _separator = Path.DirectorySeparatorChar.ToString();
 63
 64  /// <summary>Alternate folder name separator.</summary>
 165  protected static readonly string _separatorAlt = Path.AltDirectorySeparatorChar.ToString();
 66
 67  /// <summary>Sorting comparer for the collections.</summary>
 168  private static readonly StringComparer _comparer = StringComparer.OrdinalIgnoreCase;
 69
 70  /// <summary>Default constructor.</summary>
 2271  protected FolderInfoBase()
 2272  {
 2273    Location = string.Empty;
 2274    FileList = new SortedList<string, string>( _comparer );
 2275    FolderList = new SortedList<string, IFolderInfo>( _comparer );
 2276  }
 77
 78  #endregion
 79}