Attempted to Test CacheService, but can't figure it out.

This commit is contained in:
Joseph Milazzo 2021-01-26 14:35:50 -06:00
parent 1d61d1057e
commit f430595d11
9 changed files with 96 additions and 22 deletions

View file

@ -33,10 +33,9 @@ namespace API.Services
reSearchPattern.IsMatch(Path.GetExtension(file)));
}
public static string[] GetFiles(string path)
public string[] GetFiles(string path)
{
if (!Directory.Exists(path)) return Array.Empty<string>();
return Directory.GetFiles(path);
return !Directory.Exists(path) ? Array.Empty<string>() : Directory.GetFiles(path);
}
public IEnumerable<string> ListDirectory(string rootPath)
@ -48,7 +47,6 @@ namespace API.Services
.Where(dir => !(dir.Attributes.HasFlag(FileAttributes.Hidden) || dir.Attributes.HasFlag(FileAttributes.System)))
.Select(d => d.Name).ToImmutableList();
return dirs;
}