File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,30 @@ public void MockDirectory_GetFiles_ShouldReturnAllFilesBelowPathWhenPatternIsWil
7979 Assert . That ( result , Is . EquivalentTo ( expected ) ) ;
8080 }
8181
82+ #if FEATURE_ENUMERATION_OPTIONS
83+ [ Test ]
84+ public void MockDirectory_GetFiles_ShouldReturnAllPatternMatchingFilesWhenEnumerationOptionHasRecurseSubdirectoriesSetToTrue ( )
85+ {
86+ // Arrange
87+ var fileSystem = SetupFileSystem ( ) ;
88+ var expected = new [ ]
89+ {
90+ XFS . Path ( @"c:\b.txt" ) ,
91+ XFS . Path ( @"c:\c.txt" ) ,
92+ XFS . Path ( @"c:\a\a.txt" ) ,
93+ XFS . Path ( @"c:\a\c.txt" ) ,
94+ XFS . Path ( @"c:\a\a\a.txt" ) ,
95+ XFS . Path ( @"c:\a\a\b.txt" )
96+ } ;
97+
98+ // Act
99+ var result = fileSystem . Directory . GetFiles ( XFS . Path ( @"c:\" ) , "*.txt" , new EnumerationOptions { RecurseSubdirectories = true } ) ;
100+
101+ // Assert
102+ Assert . That ( result , Is . EquivalentTo ( expected ) ) ;
103+ }
104+ #endif
105+
82106 private MockFileSystem SetupFileSystem ( )
83107 {
84108 return new MockFileSystem ( new Dictionary < string , MockFileData >
You can’t perform that action at this time.
0 commit comments