@@ -35,7 +35,7 @@ public virtual async Task CanGetEmptyFileListOnMissingDirectoryAsync()
3535
3636        using  ( storage ) 
3737        { 
38-             Assert . Empty ( await  storage . GetFileListAsync ( Guid . NewGuid ( )   +   " \\ *") ) ; 
38+             Assert . Empty ( await  storage . GetFileListAsync ( $ " { Guid . NewGuid ( ) } \\ *") ) ; 
3939        } 
4040    } 
4141
@@ -283,11 +283,12 @@ public virtual async Task CanDeleteEntireFolderAsync()
283283
284284        using  ( storage ) 
285285        { 
286+             await  storage . SaveFileAsync ( @"x\README" ,  "hello" ) ; 
286287            await  storage . SaveFileAsync ( @"x\hello.txt" ,  "hello" ) ; 
287288            await  storage . SaveFileAsync ( @"x\nested\world.csv" ,  "nested world" ) ; 
288-             Assert . Equal ( 2 ,  ( await  storage . GetFileListAsync ( ) ) . Count ) ; 
289+             Assert . Equal ( 3 ,  ( await  storage . GetFileListAsync ( ) ) . Count ) ; 
289290
290-             await  storage . DeleteFilesAsync ( @"x\*" ) ; 
291+             Assert . Equal ( 3 ,   await  storage . DeleteFilesAsync ( @"x\*" ) ) ; 
291292            Assert . Empty ( await  storage . GetFileListAsync ( ) ) ; 
292293        } 
293294    } 
@@ -304,13 +305,14 @@ public virtual async Task CanDeleteEntireFolderWithWildcardAsync()
304305        { 
305306            await  storage . SaveFileAsync ( @"x\hello.txt" ,  "hello" ) ; 
306307            await  storage . SaveFileAsync ( @"x\nested\world.csv" ,  "nested world" ) ; 
307-             Assert . Equal ( 2 ,   ( await  storage . GetFileListAsync ( ) ) . Count ) ; 
308+             await  storage . SaveFileAsync ( @"x\nested\docs\README" ,   "manual" ) ; 
308309            Assert . Single ( await  storage . GetFileListAsync ( limit :  1 ) ) ; 
309-             Assert . Equal ( 2 ,  ( await  storage . GetFileListAsync ( @"x\*" ) ) . Count ) ; 
310-             Assert . Single ( await  storage . GetFileListAsync ( @"x\nested\ *" ) ) ; 
311- 
312-             await  storage . DeleteFilesAsync ( @"x\*"  ) ; 
310+             Assert . Equal ( 3 ,  ( await  storage . GetFileListAsync ( ) ) . Count ) ; 
311+             Assert . Equal ( 3 ,   ( await  storage . GetFileListAsync ( @"x\*" ) ) . Count ) ; 
312+              Assert . Equal ( 2 ,   ( await   storage . GetFileListAsync ( @"x\nested\*" ) ) . Count ) ; 
313+             Assert . Single ( await  storage . GetFileListAsync ( @"x\nested\docs\*"  ) ) ; 
313314
315+             Assert . Equal ( 3 ,  await  storage . DeleteFilesAsync ( @"x\*" ) ) ; 
314316            Assert . Empty ( await  storage . GetFileListAsync ( ) ) ; 
315317        } 
316318    } 
@@ -388,20 +390,30 @@ public virtual async Task CanDeleteNestedFolderAsync()
388390        using  ( storage ) 
389391        { 
390392            await  storage . SaveFileAsync ( @"x\hello.txt" ,  "hello" ) ; 
391-             await  storage . SaveFileAsync ( @"x\nested\world.csv" ,  "nested world" ) ; 
392393            await  storage . SaveFileAsync ( @"x\nested\hello.txt" ,  "nested hello" ) ; 
393-             Assert . Equal ( 3 ,  ( await  storage . GetFileListAsync ( ) ) . Count ) ; 
394+             await  storage . SaveFileAsync ( @"x\nested\world.csv" ,  "nested world" ) ; 
395+             await  storage . SaveFileAsync ( @"x\nested\docs\README" ,  "README" ) ; 
396+             await  storage . SaveFileAsync ( @"x\nested\media\README" ,  "README" ) ; 
397+             Assert . Equal ( 5 ,  ( await  storage . GetFileListAsync ( ) ) . Count ) ; 
394398            Assert . Single ( await  storage . GetFileListAsync ( limit :  1 ) ) ; 
395-             Assert . Equal ( 3 ,  ( await  storage . GetFileListAsync ( @"x\*" ) ) . Count ) ; 
396-             Assert . Equal ( 2 ,  ( await  storage . GetFileListAsync ( @"x\nested\*" ) ) . Count ) ; 
399+             Assert . Equal ( 5 ,  ( await  storage . GetFileListAsync ( @"x\*" ) ) . Count ) ; 
400+             Assert . Equal ( 4 ,  ( await  storage . GetFileListAsync ( @"x\nested\*" ) ) . Count ) ; 
397401            Assert . Equal ( 2 ,  ( await  storage . GetFileListAsync ( @"x\*.txt" ) ) . Count ) ; 
398402
399-             await  storage . DeleteFilesAsync ( @"x\nested\*" ) ; 
403+             Assert . Equal ( 1 ,  await  storage . DeleteFilesAsync ( @"x\nested\docs\" ) ) ; 
404+             Assert . Equal ( 1 ,  await  storage . DeleteFilesAsync ( @"x\nested\media" ) ) ; 
405+             Assert . Equal ( 2 ,  await  storage . DeleteFilesAsync ( @"x\nested\*" ) ) ; 
400406
401407            Assert . Single ( await  storage . GetFileListAsync ( ) ) ; 
402408            Assert . True ( await  storage . ExistsAsync ( @"x\hello.txt" ) ) ; 
403409            Assert . False ( await  storage . ExistsAsync ( @"x\nested\hello.txt" ) ) ; 
404410            Assert . False ( await  storage . ExistsAsync ( @"x\nested\world.csv" ) ) ; 
411+             Assert . False ( await  storage . ExistsAsync ( @"x\nested\docs\README" ) ) ; 
412+             Assert . False ( await  storage . ExistsAsync ( @"x\nested\media\README" ) ) ; 
413+ 
414+             Assert . Equal ( 1 ,  await  storage . DeleteFilesAsync ( @"x\hello*" ) ) ; 
415+             Assert . Empty ( await  storage . GetFileListAsync ( ) ) ; 
416+             Assert . False ( await  storage . ExistsAsync ( @"x\hello.txt" ) ) ; 
405417        } 
406418    } 
407419
@@ -426,7 +438,7 @@ public virtual async Task CanDeleteSpecificFilesInNestedFolderAsync()
426438            Assert . Equal ( 3 ,  ( await  storage . GetFileListAsync ( @"x\nested\*" ) ) . Count ) ; 
427439            Assert . Equal ( 3 ,  ( await  storage . GetFileListAsync ( @"x\*.txt" ) ) . Count ) ; 
428440
429-             await  storage . DeleteFilesAsync ( @"x\nested\*.txt" ) ; 
441+             Assert . Equal ( 2 ,   await  storage . DeleteFilesAsync ( @"x\nested\*.txt" ) ) ; 
430442
431443            Assert . Equal ( 3 ,  ( await  storage . GetFileListAsync ( ) ) . Count ) ; 
432444            Assert . True ( await  storage . ExistsAsync ( @"x\hello.txt" ) ) ; 
0 commit comments