diff --git a/src/Foundatio.TestHarness/Storage/FileStorageTestsBase.cs b/src/Foundatio.TestHarness/Storage/FileStorageTestsBase.cs index 4adb3929..ca531b0d 100644 --- a/src/Foundatio.TestHarness/Storage/FileStorageTestsBase.cs +++ b/src/Foundatio.TestHarness/Storage/FileStorageTestsBase.cs @@ -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); } }