|
|
@ -1,5 +1,6 @@
|
|
|
|
using FluentAssertions;
|
|
|
|
using FluentAssertions;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
using NzbDrone.Core.DecisionEngine.Specifications;
|
|
|
|
using NzbDrone.Core.DecisionEngine.Specifications;
|
|
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
@ -7,7 +8,6 @@ using NzbDrone.Core.Test.Framework;
|
|
|
|
namespace NzbDrone.Core.Test.DecisionEngineTests
|
|
|
|
namespace NzbDrone.Core.Test.DecisionEngineTests
|
|
|
|
{
|
|
|
|
{
|
|
|
|
[TestFixture]
|
|
|
|
[TestFixture]
|
|
|
|
|
|
|
|
|
|
|
|
public class AllowedReleaseGroupSpecificationFixture : CoreTest<AllowedReleaseGroupSpecification>
|
|
|
|
public class AllowedReleaseGroupSpecificationFixture : CoreTest<AllowedReleaseGroupSpecification>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private RemoteEpisode _parseResult;
|
|
|
|
private RemoteEpisode _parseResult;
|
|
|
@ -27,6 +27,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_be_true_when_allowedReleaseGroups_is_empty()
|
|
|
|
public void should_be_true_when_allowedReleaseGroups_is_empty()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
Subject.IsSatisfiedBy(_parseResult).Should().BeTrue();
|
|
|
|
Subject.IsSatisfiedBy(_parseResult).Should().BeTrue();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -36,15 +37,21 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
|
|
|
Subject.IsSatisfiedBy(_parseResult).Should().BeTrue();
|
|
|
|
Subject.IsSatisfiedBy(_parseResult).Should().BeTrue();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[TestCase("2HD")]
|
|
|
|
public void should_be_true_when_allowedReleaseGroups_contains_nzbs_releaseGroup()
|
|
|
|
[TestCase("2hd")]
|
|
|
|
|
|
|
|
[TestCase("other, 2hd, next")]
|
|
|
|
|
|
|
|
[TestCase("other,2hd,next")]
|
|
|
|
|
|
|
|
[TestCase("other,2hd,next,")]
|
|
|
|
|
|
|
|
public void should_be_true_when_allowedReleaseGroups_contains_nzbs_releaseGroup(string allowedList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.AllowedReleaseGroups).Returns(allowedList);
|
|
|
|
Subject.IsSatisfiedBy(_parseResult).Should().BeTrue();
|
|
|
|
Subject.IsSatisfiedBy(_parseResult).Should().BeTrue();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_be_false_when_allowedReleaseGroups_does_not_contain_nzbs_releaseGroup()
|
|
|
|
public void should_be_false_when_allowedReleaseGroups_does_not_contain_nzbs_releaseGroup()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Mocker.GetMock<IConfigService>().SetupGet(c => c.AllowedReleaseGroups).Returns("other");
|
|
|
|
Subject.IsSatisfiedBy(_parseResult).Should().BeFalse();
|
|
|
|
Subject.IsSatisfiedBy(_parseResult).Should().BeFalse();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|