Skip to content

Commit

Permalink
Added more asserts to storage test
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski committed Jan 5, 2024
1 parent eb9a76c commit 3c572ce
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Foundatio.TestHarness/Storage/FileStorageTestsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,16 @@ public virtual async Task WillWriteStreamContentAsync()

using (storage)
{
await using (var writer = new StreamWriter(await storage.GetFileStreamAsync(path, StreamMode.Write), Encoding.UTF8, 1024, false))
await using var stream = await storage.GetFileStreamAsync(path, StreamMode.Write);
Assert.NotNull(stream);
Assert.True(stream.CanWrite);

await using (var writer = new StreamWriter(stream, Encoding.UTF8, 1024, false))
{
await writer.WriteAsync(testContent);
}

string content = await storage.GetFileContentsAsync(path);

Assert.Equal(testContent, content);
}
}
Expand Down

0 comments on commit 3c572ce

Please sign in to comment.