refactor: Add LeafDirectories() extension method for MockFileSystem

pull/201/head
Robert Dailey 2 years ago
parent f1f9887042
commit 2c7f220a71

@ -50,4 +50,9 @@ public static class CommonMockFileSystemExtensions
var resourcePath = $"{typeInAssembly.Namespace}.{embeddedResourcePath}";
fs.AddFileFromEmbeddedResource(path, typeInAssembly.Assembly, resourcePath);
}
public static IEnumerable<string> LeafDirectories(this MockFileSystem fs)
{
return fs.AllDirectories.Where(x => !fs.AllDirectories.Any(y => y.StartsWith(x) && y != x));
}
}

Loading…
Cancel
Save