diff --git a/src/Recyclarr.Common.TestLibrary/CommonMockFileSystemExtensions.cs b/src/Recyclarr.Common.TestLibrary/CommonMockFileSystemExtensions.cs index e7a9870e..d8afc537 100644 --- a/src/Recyclarr.Common.TestLibrary/CommonMockFileSystemExtensions.cs +++ b/src/Recyclarr.Common.TestLibrary/CommonMockFileSystemExtensions.cs @@ -50,4 +50,9 @@ public static class CommonMockFileSystemExtensions var resourcePath = $"{typeInAssembly.Namespace}.{embeddedResourcePath}"; fs.AddFileFromEmbeddedResource(path, typeInAssembly.Assembly, resourcePath); } + + public static IEnumerable LeafDirectories(this MockFileSystem fs) + { + return fs.AllDirectories.Where(x => !fs.AllDirectories.Any(y => y.StartsWith(x) && y != x)); + } }