Skip to content

Commit

Permalink
test(FileSystemApi)" stream properties
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed May 30, 2019
1 parent e384b79 commit 73231de
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/CoreApi/FileSystemApiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,23 @@ public async Task Add_SizeChunking()
Assert.AreEqual("hello world", text);
}

[TestMethod]
public async Task StreamBehaviour()
{
var ipfs = TestFixture.Ipfs;
var options = new AddFileOptions
{
ChunkSize = 3,
Pin = true,
};
var node = await ipfs.FileSystem.AddTextAsync("hello world", options);
var stream = await ipfs.FileSystem.ReadFileAsync(node.Id);
Assert.AreEqual(11, stream.Length);
Assert.IsTrue(stream.CanRead);
Assert.IsFalse(stream.CanWrite);
Assert.IsTrue(stream.CanSeek);
}

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

0 comments on commit 73231de

Please sign in to comment.