public IEnumerable<string> EnumerateFiles(SearchParameters searchParameters)
 {
     return Directory.EnumerateFiles(
         searchParameters.Path,
         searchParameters.Pattern,
         searchParameters.Recursive
             ? SearchOption.AllDirectories
             : SearchOption.TopDirectoryOnly);
 }
 public void FileSystemProvider_Test_Enumerate_Returns_All_Files()
 {
     var path = Path.Combine(CurrentDirectory.FullName, Paths.App_Config.Path);
     IFileSystemProvider fileSystemProvider = new FileSystemProvider();
     var parameters = new SearchParameters(path, "*.*", true);
     var result = fileSystemProvider.EnumerateFiles(parameters);
     var count = 0;
     foreach(var item in result)
         count += 1;
     Assert.IsTrue(3 < count);
 }
        /// <summary>
        /// Gets the configuration list.
        /// </summary>
        /// <returns></returns>
        public virtual IDictionary<string, IConfiguration> GetConfigurationDictionary()
        {
            // resolve the path using the built in path resolver
            string rootPath = this.PathResolver.ResolvePath(this.Path);

            var searchParameters = new SearchParameters
                {
                    Path = rootPath,
                    Pattern = this.SearchPattern,
                    Recursive = this.Recursive
                };
            var files = FileProvider.EnumerateFiles(searchParameters);

            IDictionary<string, IConfiguration> configurationDictionary = new Dictionary<string, IConfiguration>();

            // iterate over the files returning each configuration that passes as it is found
            foreach (var file in files)
            {
                configurationDictionary = ProcessFile(file, configurationDictionary);
            }

            return configurationDictionary;
        }