Skip to content

Commit

Permalink
test: another test
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed Jun 19, 2019
1 parent 1daf3e0 commit 2b97ab0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/GatewayHostTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,25 @@ public async Task Should_serve_website()
Assert.AreEqual(html, content);
}

[TestMethod]
public async Task Should_browse_website_with_trailing_slash()
{
const string html = "<p>good afternoon from IPFS!</p>";
var options = new AddFileOptions
{
Wrap = true
};
var ms = new MemoryStream(Encoding.UTF8.GetBytes(html));
var node = await ipfs.FileSystem.AddAsync(ms, "index.html", options);
var url = $"{gateway.IpfsUrl(node.Id)}/";

var httpClient = new HttpClient();
var content = await httpClient.GetStringAsync(url);
StringAssert.Contains(content, "<html>");
StringAssert.Contains(content, node.Id.Encode());
StringAssert.Contains(content, "index.html");
}

[TestMethod]
public async Task Should_browse_directory_without_index()
{
Expand Down

0 comments on commit 2b97ab0

Please sign in to comment.