1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-01-01 04:38:20 +00:00

core: Allow unit tests to run in non-Windows environments (#7022)

This commit is contained in:
junglebus 2020-02-06 13:21:48 +11:00 committed by GitHub
parent 163b162b2d
commit 67750982bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View file

@ -28,6 +28,7 @@
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.10.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.7.0" />
</ItemGroup>
<ItemGroup>

View file

@ -15,12 +15,7 @@ namespace Jackett.Test
public WebUtilityHelpersTests()
{
//https://docs.microsoft.com/en-us/dotnet/api/system.text.codepagesencodingprovider?view=netcore-2.0
#if !NET461
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
}
#endif
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
_codePagesToTest = new Encoding[]{
Encoding.UTF8,