Skip to content

Commit

Permalink
rename TestUtils.Encodings to Encodings
Browse files Browse the repository at this point in the history
  • Loading branch information
smdn committed Apr 15, 2022
1 parent c7f3cf2 commit ba3937d
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/Smdn.Test.NUnit.Utils/Smdn.Test.NUnit/Encodings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@
// SPDX-License-Identifier: MIT
using System.Text;

namespace Smdn.Test.NUnit {
public static partial class TestUtils {
public static class Encodings {
public static readonly Encoding Latin1 = Encoding.GetEncoding("latin1");
public static readonly Encoding Jis = GetEncoding("iso-2022-jp");
public static readonly Encoding ShiftJis = GetEncoding("shift_jis");
public static readonly Encoding EucJP = GetEncoding("euc-jp");
namespace Smdn.Test.NUnit;

private static Encoding GetEncoding(string name)
public static class Encodings {
public static readonly Encoding Latin1 = Encoding.GetEncoding("latin1");
public static readonly Encoding Jis = GetEncoding("iso-2022-jp");
public static readonly Encoding ShiftJis = GetEncoding("shift_jis");
public static readonly Encoding EucJP = GetEncoding("euc-jp");

private static Encoding GetEncoding(string name)
#if NETFRAMEWORK
=> Encoding.GetEncoding(name);
=> Encoding.GetEncoding(name);
#else
=> CodePagesEncodingProvider.Instance.GetEncoding(name);
=> CodePagesEncodingProvider.Instance.GetEncoding(name);
#endif
}
}
}

0 comments on commit ba3937d

Please sign in to comment.