1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-23 22:25:56 -04:00

Fixed: Skip anime version upgrade check if Proper/Repacks are not preferred

Closes #4468
This commit is contained in:
Mark McDowall
2022-12-11 18:01:51 -08:00
parent e42edf1d33
commit 8bea8a10da
2 changed files with 28 additions and 1 deletions
@@ -2,6 +2,7 @@ using System.Linq;
using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.DecisionEngine.Specifications;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Parser.Model;
@@ -21,6 +22,10 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[SetUp]
public void Setup()
{
Mocker.GetMock<IConfigService>()
.Setup(s => s.DownloadPropersAndRepacks)
.Returns(ProperDownloadTypes.PreferAndUpgrade);
Mocker.Resolve<UpgradableSpecification>();
_subject = Mocker.Resolve<AnimeVersionUpgradeSpecification>();
@@ -104,5 +109,15 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
{
_subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeFalse();
}
[Test]
public void should_return_true_when_repacks_are_not_preferred()
{
Mocker.GetMock<IConfigService>()
.Setup(s => s.DownloadPropersAndRepacks)
.Returns(ProperDownloadTypes.DoNotPrefer);
_subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeFalse();
}
}
}