2013-04-07 19:53:04 +02:00
|
|
|
|
using System;
|
2012-08-07 07:24:15 +02:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using FluentAssertions;
|
|
|
|
|
using NUnit.Framework;
|
2013-03-07 01:19:49 +01:00
|
|
|
|
using NzbDrone.Core.DecisionEngine.Specifications;
|
2013-02-27 04:19:22 +01:00
|
|
|
|
using NzbDrone.Core.Qualities;
|
2013-02-19 07:01:03 +01:00
|
|
|
|
using NzbDrone.Core.Tv;
|
2012-08-07 07:24:15 +02:00
|
|
|
|
using NzbDrone.Core.Model;
|
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
|
2013-02-19 03:19:38 +01:00
|
|
|
|
namespace NzbDrone.Core.Test.DecisionEngineTests
|
2012-08-07 07:24:15 +02:00
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2013-04-07 19:53:04 +02:00
|
|
|
|
|
|
|
|
|
public class AllowedReleaseGroupSpecificationFixture : CoreTest<AllowedReleaseGroupSpecification>
|
2012-08-07 07:24:15 +02:00
|
|
|
|
{
|
|
|
|
|
private EpisodeParseResult parseResult;
|
|
|
|
|
|
|
|
|
|
[SetUp]
|
|
|
|
|
public void Setup()
|
|
|
|
|
{
|
|
|
|
|
parseResult = new EpisodeParseResult
|
|
|
|
|
{
|
|
|
|
|
SeriesTitle = "Title",
|
|
|
|
|
Language = LanguageType.English,
|
2013-02-27 04:19:22 +01:00
|
|
|
|
Quality = new QualityModel(Quality.SDTV, true),
|
2012-08-07 07:24:15 +02:00
|
|
|
|
EpisodeNumbers = new List<int> { 3 },
|
|
|
|
|
SeasonNumber = 12,
|
|
|
|
|
AirDate = DateTime.Now.AddDays(-12).Date,
|
|
|
|
|
ReleaseGroup = "2HD"
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_be_true_when_allowedReleaseGroups_is_empty()
|
|
|
|
|
{
|
2013-04-07 19:53:04 +02:00
|
|
|
|
Subject.IsSatisfiedBy(parseResult).Should().BeTrue();
|
2012-08-07 07:24:15 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_be_true_when_allowedReleaseGroups_is_nzbs_releaseGroup()
|
|
|
|
|
{
|
2013-04-07 19:53:04 +02:00
|
|
|
|
Subject.IsSatisfiedBy(parseResult).Should().BeTrue();
|
2012-08-07 07:24:15 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_be_true_when_allowedReleaseGroups_contains_nzbs_releaseGroup()
|
|
|
|
|
{
|
2013-04-07 19:53:04 +02:00
|
|
|
|
Subject.IsSatisfiedBy(parseResult).Should().BeTrue();
|
2012-08-07 07:24:15 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_be_false_when_allowedReleaseGroups_does_not_contain_nzbs_releaseGroup()
|
|
|
|
|
{
|
2013-04-07 19:53:04 +02:00
|
|
|
|
Subject.IsSatisfiedBy(parseResult).Should().BeFalse();
|
2012-08-07 07:24:15 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|