From 189963ad978a5836b5d5e25ac5593f90f3803a17 Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Thu, 8 Oct 2026 10:23:06 -0400 Subject: [PATCH] Remove unused TempFile.FromResource(Stream) test helper It ignored Stream.Read's return value (CA2022 on net10.0) and wrote a stray trailing zero byte. Nothing calls it. Co-Authored-By: Claude Opus 5.5 --- src/L10NSharp.Tests/TempFile.cs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/L10NSharp.Tests/TempFile.cs b/src/L10NSharp.Tests/TempFile.cs index ee59c5c..7f50b56 100644 --- a/src/L10NSharp.Tests/TempFile.cs +++ b/src/L10NSharp.Tests/TempFile.cs @@ -138,20 +138,6 @@ public static TempFile WithFilenameInTempFolder(string fileName) return result; } - /// - /// Used to make a real file out of a resource for the purpose of testing - /// - /// e.g., an audio resource - /// with or without '.', will work the same - public static TempFile FromResource(Stream resource, string extension) - { - var f = WithExtension(extension); - byte[] buffer = new byte[resource.Length + 1]; - resource.Read(buffer, 0, (int)resource.Length); - File.WriteAllBytes(f.Path, buffer); - return f; - } - /// /// Used to make a real file out of a resource for the purpose of testing ///