2013-04-15 01:41:39 +00:00
|
|
|
|
using FluentAssertions;
|
2012-08-07 05:24:15 +00:00
|
|
|
|
using NUnit.Framework;
|
2013-03-07 00:19:49 +00:00
|
|
|
|
using NzbDrone.Core.DecisionEngine.Specifications;
|
2013-04-15 01:41:39 +00:00
|
|
|
|
using NzbDrone.Core.Parser.Model;
|
2012-08-07 05:24:15 +00:00
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
|
2013-02-19 02:19:38 +00:00
|
|
|
|
namespace NzbDrone.Core.Test.DecisionEngineTests
|
2012-08-07 05:24:15 +00:00
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2013-04-07 17:53:04 +00:00
|
|
|
|
|
|
|
|
|
public class AllowedReleaseGroupSpecificationFixture : CoreTest<AllowedReleaseGroupSpecification>
|
2012-08-07 05:24:15 +00:00
|
|
|
|
{
|
2013-04-15 01:41:39 +00:00
|
|
|
|
private RemoteEpisode _parseResult;
|
2012-08-07 05:24:15 +00:00
|
|
|
|
|
|
|
|
|
[SetUp]
|
|
|
|
|
public void Setup()
|
|
|
|
|
{
|
2013-04-15 01:41:39 +00:00
|
|
|
|
_parseResult = new RemoteEpisode
|
|
|
|
|
{
|
|
|
|
|
Report = new ReportInfo
|
|
|
|
|
{
|
|
|
|
|
ReleaseGroup = "2HD"
|
|
|
|
|
}
|
|
|
|
|
};
|
2012-08-07 05:24:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_be_true_when_allowedReleaseGroups_is_empty()
|
|
|
|
|
{
|
2013-04-15 01:41:39 +00:00
|
|
|
|
Subject.IsSatisfiedBy(_parseResult).Should().BeTrue();
|
2012-08-07 05:24:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_be_true_when_allowedReleaseGroups_is_nzbs_releaseGroup()
|
|
|
|
|
{
|
2013-04-15 01:41:39 +00:00
|
|
|
|
Subject.IsSatisfiedBy(_parseResult).Should().BeTrue();
|
2012-08-07 05:24:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_be_true_when_allowedReleaseGroups_contains_nzbs_releaseGroup()
|
|
|
|
|
{
|
2013-04-15 01:41:39 +00:00
|
|
|
|
Subject.IsSatisfiedBy(_parseResult).Should().BeTrue();
|
2012-08-07 05:24:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_be_false_when_allowedReleaseGroups_does_not_contain_nzbs_releaseGroup()
|
|
|
|
|
{
|
2013-04-15 01:41:39 +00:00
|
|
|
|
Subject.IsSatisfiedBy(_parseResult).Should().BeFalse();
|
2012-08-07 05:24:15 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|