public Task Simple() { var directory = Path.Combine(AssemblyLocation.CurrentDirectory, "IncludeFileFinder/Simple"); var finder = new IncludeFileFinder(); var files = finder.FindFiles(directory); return(Verify(files)); }
public Task VerifyLambdasAreCalled() { var directories = new ConcurrentBag <string>(); var targetDirectory = Path.Combine(AssemblyLocation.CurrentDirectory, "IncludeFileFinder/VerifyLambdasAreCalled"); var finder = new IncludeFileFinder( directoryFilter: path => { directories.Add(path); return(true); } ); finder.FindFiles(targetDirectory); return(Verify(directories.OrderBy(file => file))); }
public IReadOnlyList <Include> ReadIncludes(params string[] directories) { Guard.AgainstNull(directories, nameof(directories)); var files = fileFinder.FindFiles(directories).ToList(); var dictionary = new Dictionary <string, Include>(StringComparer.OrdinalIgnoreCase); foreach (var file in files) { var key = Path.GetFileName(file).Replace(".include.md", ""); if (dictionary.ContainsKey(key)) { throw new Exception($"Duplicate include: {key}"); } dictionary[key] = Include.Build(key, File.ReadAllLines(file), file); } return(dictionary.Values.ToList()); }