From 0d5e7f8e832a0ddf06c6419e84a02b2cef20952b Mon Sep 17 00:00:00 2001 From: Spencer Farley <2847259+farlee2121@users.noreply.github.com> Date: Tue, 5 Dec 2023 17:58:13 -0600 Subject: [PATCH] Update utf-7 reliant tests to utf-8 Utf-7 was depricated with .NET 5. Winforms also updated their tests, links below. https://github.com/dotnet/winforms/blob/ab66fbd11b8bf029da5031cae891dada08bbd56b/src/System.Windows.Forms/tests/UnitTests/System/Resources/ResXFileRef.ConverterTests.cs#L62 https://github.com/dotnet/winforms/blob/ab66fbd11b8bf029da5031cae891dada08bbd56b/src/System.Windows.Forms/tests/UnitTests/TestResources/Files/text.utf8.txt#L1C4-L1C4 --- Tests/ResXFileRef.ConverterTests.cs | 3 ++- Tests/System.Resources.Tests.csproj | 3 ++- Tests/TestResources/Files/text.utf7.txt | 1 - Tests/TestResources/Files/text.utf8.txt | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 Tests/TestResources/Files/text.utf7.txt create mode 100644 Tests/TestResources/Files/text.utf8.txt diff --git a/Tests/ResXFileRef.ConverterTests.cs b/Tests/ResXFileRef.ConverterTests.cs index c07b6e4..c9e6273 100644 --- a/Tests/ResXFileRef.ConverterTests.cs +++ b/Tests/ResXFileRef.ConverterTests.cs @@ -59,11 +59,12 @@ public void ConvertFrom_ReadsFileAsString() Assert.Equal(expected, result); } + [Fact] public void ConvertFrom_ReadsFileAsStringUsingEncodingFromRefString() { - var resxFileRefString = @"TestResources/Files/text.utf7.txt;System.String;utf-7"; + var resxFileRefString = @"TestResources\Files\text.utf8.txt;System.String;utf-8"; var expected = "Привет"; var converter = new ResXFileRef.Converter(); diff --git a/Tests/System.Resources.Tests.csproj b/Tests/System.Resources.Tests.csproj index e46a6e2..09d3baf 100644 --- a/Tests/System.Resources.Tests.csproj +++ b/Tests/System.Resources.Tests.csproj @@ -1,4 +1,4 @@ - + net8 @@ -18,6 +18,7 @@ + diff --git a/Tests/TestResources/Files/text.utf7.txt b/Tests/TestResources/Files/text.utf7.txt deleted file mode 100644 index 31befc8..0000000 --- a/Tests/TestResources/Files/text.utf7.txt +++ /dev/null @@ -1 +0,0 @@ -+BB8EQAQ4BDIENQRC- \ No newline at end of file diff --git a/Tests/TestResources/Files/text.utf8.txt b/Tests/TestResources/Files/text.utf8.txt new file mode 100644 index 0000000..1d122a1 --- /dev/null +++ b/Tests/TestResources/Files/text.utf8.txt @@ -0,0 +1 @@ +Привет \ No newline at end of file