From 3c572ce3c1ca0286e18bc3311a70b7aefc29e5d2 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Fri, 5 Jan 2024 14:13:00 -0600 Subject: [PATCH] Added more asserts to storage test --- src/Foundatio.TestHarness/Storage/FileStorageTestsBase.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); } }