Reject non-english releases

NzbDrone, now with more rejection built in
This commit is contained in:
Mark McDowall
2013-01-15 17:36:02 -08:00
parent 7eb522f871
commit f556f2aaf2
6 changed files with 119 additions and 2 deletions
@@ -56,6 +56,10 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
Mocker.GetMock<CustomStartDateSpecification>()
.Setup(c => c.IsSatisfiedBy(It.IsAny<EpisodeParseResult>()))
.Returns(true);
Mocker.GetMock<LanguageSpecification>()
.Setup(c => c.IsSatisfiedBy(It.IsAny<EpisodeParseResult>()))
.Returns(true);
}
private void WithProfileNotAllowed()
@@ -100,6 +104,13 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
.Returns(false);
}
private void WithLanguageNotWanted()
{
Mocker.GetMock<LanguageSpecification>()
.Setup(c => c.IsSatisfiedBy(It.IsAny<EpisodeParseResult>()))
.Returns(false);
}
[Test]
public void should_be_allowed_if_all_conditions_are_met()
{
@@ -158,5 +169,13 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.QualityNotWanted);
}
[Test]
public void should_not_be_allowed_if_language_is_not_wanted()
{
WithLanguageNotWanted();
spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.LanguageNotWanted);
}
}
}