Skip to content

Commit

Permalink
new test,
Browse files Browse the repository at this point in the history
quick fix azure list globbing at root
  • Loading branch information
sandorfr committed Jul 6, 2016
1 parent 690bc1c commit cf2f0e0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public AzureListDirectoryWrapper(FileSystemInfoBase childrens)

public AzureListDirectoryWrapper(string path, Dictionary<string, AzureFileReference> files)
{
this.path = path;
this.path = path ?? "";
this.files = files;
this.fullName = path;
var lastSlash = path.LastIndexOf('/');
this.fullName = this.path;
var lastSlash = this.path.LastIndexOf('/');
if (lastSlash >= 0)
{
this.name = path.Substring(lastSlash + 1);
Expand Down
19 changes: 19 additions & 0 deletions tests/GeekLearning.Integration.Test/ListTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,24 @@ public async Task FileNameGlobbing(string storeName)
Assert.Empty(missingFiles);
Assert.Empty(unexpectedFiles);
}

[Theory(DisplayName = nameof(FileNameGlobbingAtRoot)), InlineData("azure"), InlineData("filesystem")]
public async Task FileNameGlobbingAtRoot(string storeName)
{
var storageFactory = this.storeFixture.Services.GetRequiredService<IStorageFactory>();

var store = storageFactory.GetStore(storeName);

var expected = new string[] { "template.hbs" };

var results = await store.ListAsync("", "template.*");

var missingFiles = expected.Except(results.Select(f => f.Path)).ToArray();

var unexpectedFiles = results.Select(f => f.Path).Except(expected).ToArray();

Assert.Empty(missingFiles);
Assert.Empty(unexpectedFiles);
}
}
}

0 comments on commit cf2f0e0

Please sign in to comment.