From 1ba4a4f5a09b05f152a50eb0b39b6d5f52738e94 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Fri, 5 Jan 2024 14:05:20 -0600 Subject: [PATCH] test updates --- src/Foundatio.TestHarness/Storage/FileStorageTestsBase.cs | 5 ++--- src/Foundatio/Storage/FolderFileStorage.cs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Foundatio.TestHarness/Storage/FileStorageTestsBase.cs b/src/Foundatio.TestHarness/Storage/FileStorageTestsBase.cs index d1381356..0791a0ae 100644 --- a/src/Foundatio.TestHarness/Storage/FileStorageTestsBase.cs +++ b/src/Foundatio.TestHarness/Storage/FileStorageTestsBase.cs @@ -515,13 +515,12 @@ public virtual async Task WillWriteStreamContentAsync() using (storage) { - - using (var writer = new StreamWriter(await storage.GetFileStreamAsync(path, StreamMode.Write), Encoding.UTF8, 1024, false)) + await using (var writer = new StreamWriter(await storage.GetFileStreamAsync(path, StreamMode.Write), Encoding.UTF8, 1024, false)) { await writer.WriteAsync(testContent); } - var content = await storage.GetFileContentsAsync(path); + string content = await storage.GetFileContentsAsync(path); Assert.Equal(testContent, content); } diff --git a/src/Foundatio/Storage/FolderFileStorage.cs b/src/Foundatio/Storage/FolderFileStorage.cs index 146ba77f..ab5ed834 100644 --- a/src/Foundatio/Storage/FolderFileStorage.cs +++ b/src/Foundatio/Storage/FolderFileStorage.cs @@ -69,7 +69,7 @@ public Stream GetFileStreamAsync(string path, FileAccess fileAccess) throw new ArgumentNullException(nameof(path)); string normalizedPath = path.NormalizePath(); - var fullPath = Path.Combine(Folder, normalizedPath); + string fullPath = Path.Combine(Folder, normalizedPath); if (fileAccess != FileAccess.Read) { CreateFileStream(fullPath).Dispose();