File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
src/GeekLearning.Storage.Azure/Internal
tests/GeekLearning.Integration.Test Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,10 @@ public AzureListDirectoryWrapper(FileSystemInfoBase childrens)
2222
2323 public AzureListDirectoryWrapper ( string path , Dictionary < string , AzureFileReference > files )
2424 {
25- this . path = path ;
25+ this . path = path ?? "" ;
2626 this . files = files ;
27- this . fullName = path ;
28- var lastSlash = path . LastIndexOf ( '/' ) ;
27+ this . fullName = this . path ;
28+ var lastSlash = this . path . LastIndexOf ( '/' ) ;
2929 if ( lastSlash >= 0 )
3030 {
3131 this . name = path . Substring ( lastSlash + 1 ) ;
Original file line number Diff line number Diff line change @@ -132,5 +132,24 @@ public async Task FileNameGlobbing(string storeName)
132132 Assert . Empty ( missingFiles ) ;
133133 Assert . Empty ( unexpectedFiles ) ;
134134 }
135+
136+ [ Theory ( DisplayName = nameof ( FileNameGlobbingAtRoot ) ) , InlineData ( "azure" ) , InlineData ( "filesystem" ) ]
137+ public async Task FileNameGlobbingAtRoot ( string storeName )
138+ {
139+ var storageFactory = this . storeFixture . Services . GetRequiredService < IStorageFactory > ( ) ;
140+
141+ var store = storageFactory . GetStore ( storeName ) ;
142+
143+ var expected = new string [ ] { "template.hbs" } ;
144+
145+ var results = await store . ListAsync ( "" , "template.*" ) ;
146+
147+ var missingFiles = expected . Except ( results . Select ( f => f . Path ) ) . ToArray ( ) ;
148+
149+ var unexpectedFiles = results . Select ( f => f . Path ) . Except ( expected ) . ToArray ( ) ;
150+
151+ Assert . Empty ( missingFiles ) ;
152+ Assert . Empty ( unexpectedFiles ) ;
153+ }
135154 }
136155}
You can’t perform that action at this time.
0 commit comments