File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Source/Testably.Abstractions.Testing/FileSystemInitializer
Tests/Testably.Abstractions.Testing.Tests/FileSystemInitializer Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ private IDirectoryInfo WithDirectory(DirectoryDescription directory)
145145
146146 if ( directory . Children . Length > 0 )
147147 {
148- DirectoryInitializer < TFileSystem > subdirectoryInitializer = new ( this , directoryInfo ) ;
148+ FileSystemInitializer < TFileSystem > subdirectoryInitializer = new ( this , directoryInfo ) ;
149149 foreach ( FileSystemInfoDescription children in directory . Children )
150150 {
151151 subdirectoryInitializer . WithFileOrDirectory ( children ) ;
Original file line number Diff line number Diff line change 11using System . IO ;
2+ using System . Linq ;
23using Testably . Abstractions . Testing . FileSystemInitializer ;
34
45namespace Testably . Abstractions . Testing . Tests . FileSystemInitializer ;
@@ -21,6 +22,24 @@ public void With_DirectoryDescriptions_ShouldCreateDirectories(
2122 }
2223 }
2324
25+ [ Theory ]
26+ [ AutoData ]
27+ public void With_DirectoryDescriptions_WithSubdirectories_ShouldCreateDirectories (
28+ string parent , DirectoryDescription [ ] directories )
29+ {
30+ DirectoryDescription directoryDescription = new ( parent ,
31+ directories . Cast < FileSystemInfoDescription > ( ) . ToArray ( ) ) ;
32+ MockFileSystem fileSystem = new ( ) ;
33+ IFileSystemInitializer < MockFileSystem > sut = fileSystem . Initialize ( ) ;
34+
35+ sut . With ( directoryDescription ) ;
36+
37+ foreach ( DirectoryDescription directory in directories )
38+ {
39+ fileSystem . Should ( ) . HaveDirectory ( Path . Combine ( parent , directory . Name ) ) ;
40+ }
41+ }
42+
2443 [ Theory ]
2544 [ AutoData ]
2645 public void With_FileDescription_WithBytes_ShouldCreateFileContent ( string name , byte [ ] bytes )
You can’t perform that action at this time.
0 commit comments