2013-04-15 04:41:39 +03:00
|
|
|
using System.Collections.Generic;
|
2011-09-14 07:37:22 +03:00
|
|
|
using FizzWare.NBuilder;
|
|
|
|
using FluentAssertions;
|
|
|
|
using Moq;
|
|
|
|
using NUnit.Framework;
|
2013-03-07 03:19:49 +03:00
|
|
|
using NzbDrone.Core.DecisionEngine.Specifications;
|
2013-04-15 04:41:39 +03:00
|
|
|
using NzbDrone.Core.Parser.Model;
|
2013-02-27 06:19:22 +03:00
|
|
|
using NzbDrone.Core.Qualities;
|
2013-02-19 09:01:03 +03:00
|
|
|
using NzbDrone.Core.Tv;
|
2011-09-14 07:37:22 +03:00
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
2013-02-19 05:19:38 +03:00
|
|
|
namespace NzbDrone.Core.Test.DecisionEngineTests
|
2011-09-14 07:37:22 +03:00
|
|
|
{
|
|
|
|
[TestFixture]
|
2013-04-15 04:41:39 +03:00
|
|
|
|
|
|
|
public class AcceptableSizeSpecificationFixture : CoreTest<AcceptableSizeSpecification>
|
2011-09-14 07:37:22 +03:00
|
|
|
{
|
2013-04-15 04:41:39 +03:00
|
|
|
private RemoteEpisode parseResultMulti;
|
|
|
|
private RemoteEpisode parseResultSingle;
|
2011-09-14 07:37:22 +03:00
|
|
|
private Series series30minutes;
|
|
|
|
private Series series60minutes;
|
2013-02-27 06:19:22 +03:00
|
|
|
private QualitySize qualityType;
|
2011-09-14 07:37:22 +03:00
|
|
|
|
|
|
|
[SetUp]
|
2011-10-24 08:54:09 +03:00
|
|
|
public void Setup()
|
2011-09-14 07:37:22 +03:00
|
|
|
{
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultMulti = new RemoteEpisode
|
2011-09-14 07:37:22 +03:00
|
|
|
{
|
2013-04-15 04:41:39 +03:00
|
|
|
Report = new ReportInfo(),
|
2013-04-28 22:46:13 +03:00
|
|
|
ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.SDTV, true) },
|
2013-04-15 04:41:39 +03:00
|
|
|
Episodes = new List<Episode> { new Episode(), new Episode() }
|
2011-09-14 07:37:22 +03:00
|
|
|
};
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultSingle = new RemoteEpisode
|
2011-09-14 07:37:22 +03:00
|
|
|
{
|
2013-04-15 04:41:39 +03:00
|
|
|
Report = new ReportInfo(),
|
2013-04-28 22:46:13 +03:00
|
|
|
ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.SDTV, true) },
|
2013-04-15 04:41:39 +03:00
|
|
|
Episodes = new List<Episode> { new Episode() }
|
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
series30minutes = Builder<Series>.CreateNew()
|
|
|
|
.With(c => c.Runtime = 30)
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
series60minutes = Builder<Series>.CreateNew()
|
|
|
|
.With(c => c.Runtime = 60)
|
|
|
|
.Build();
|
|
|
|
|
2013-02-27 06:19:22 +03:00
|
|
|
qualityType = Builder<QualitySize>.CreateNew()
|
2011-09-14 07:37:22 +03:00
|
|
|
.With(q => q.MinSize = 0)
|
2011-09-16 07:42:30 +03:00
|
|
|
.With(q => q.MaxSize = 10)
|
2013-02-27 06:19:22 +03:00
|
|
|
.With(q => q.QualityId = 1)
|
2011-09-14 07:37:22 +03:00
|
|
|
.Build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IsAcceptableSize_true_single_episode_not_first_or_last_30_minute()
|
|
|
|
{
|
|
|
|
parseResultSingle.Series = series30minutes;
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultSingle.Report.Size = 184572800;
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-27 06:32:22 +03:00
|
|
|
Mocker.GetMock<IQualitySizeService>().Setup(s => s.Get(1)).Returns(qualityType);
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-22 03:47:09 +03:00
|
|
|
Mocker.GetMock<IEpisodeService>().Setup(
|
2013-04-15 04:41:39 +03:00
|
|
|
s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny<int>()))
|
2011-09-14 07:37:22 +03:00
|
|
|
.Returns(false);
|
|
|
|
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
bool result = Subject.IsSatisfiedBy(parseResultSingle);
|
|
|
|
|
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
result.Should().BeTrue();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IsAcceptableSize_true_single_episode_not_first_or_last_60_minute()
|
|
|
|
{
|
|
|
|
parseResultSingle.Series = series60minutes;
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultSingle.Report.Size = 368572800;
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-27 06:32:22 +03:00
|
|
|
Mocker.GetMock<IQualitySizeService>().Setup(s => s.Get(1)).Returns(qualityType);
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-22 03:47:09 +03:00
|
|
|
Mocker.GetMock<IEpisodeService>().Setup(
|
2013-04-15 04:41:39 +03:00
|
|
|
s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny<int>()))
|
2011-09-14 07:37:22 +03:00
|
|
|
.Returns(false);
|
|
|
|
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
bool result = Subject.IsSatisfiedBy(parseResultSingle);
|
|
|
|
|
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
result.Should().BeTrue();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IsAcceptableSize_false_single_episode_not_first_or_last_30_minute()
|
|
|
|
{
|
|
|
|
parseResultSingle.Series = series30minutes;
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultSingle.Report.Size = 1.Gigabytes();
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-27 06:32:22 +03:00
|
|
|
Mocker.GetMock<IQualitySizeService>().Setup(s => s.Get(1)).Returns(qualityType);
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-22 03:47:09 +03:00
|
|
|
Mocker.GetMock<IEpisodeService>().Setup(
|
2013-04-15 04:41:39 +03:00
|
|
|
s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny<int>()))
|
2011-09-14 07:37:22 +03:00
|
|
|
.Returns(false);
|
|
|
|
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
bool result = Subject.IsSatisfiedBy(parseResultSingle);
|
|
|
|
|
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
result.Should().BeFalse();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IsAcceptableSize_false_single_episode_not_first_or_last_60_minute()
|
|
|
|
{
|
2013-04-28 22:46:13 +03:00
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
|
|
|
|
parseResultSingle.Series = series60minutes;
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultSingle.Report.Size = 1.Gigabytes();
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-27 06:32:22 +03:00
|
|
|
Mocker.GetMock<IQualitySizeService>().Setup(s => s.Get(1)).Returns(qualityType);
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-22 03:47:09 +03:00
|
|
|
Mocker.GetMock<IEpisodeService>().Setup(
|
2013-04-15 04:41:39 +03:00
|
|
|
s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny<int>()))
|
2011-09-14 07:37:22 +03:00
|
|
|
.Returns(false);
|
|
|
|
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
bool result = Subject.IsSatisfiedBy(parseResultSingle);
|
|
|
|
|
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
result.Should().BeFalse();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IsAcceptableSize_true_multi_episode_not_first_or_last_30_minute()
|
|
|
|
{
|
2013-04-28 22:46:13 +03:00
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
|
|
|
|
parseResultMulti.Series = series30minutes;
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultMulti.Report.Size = 184572800;
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-27 06:32:22 +03:00
|
|
|
Mocker.GetMock<IQualitySizeService>().Setup(s => s.Get(1)).Returns(qualityType);
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-22 03:47:09 +03:00
|
|
|
Mocker.GetMock<IEpisodeService>().Setup(
|
2013-04-15 04:41:39 +03:00
|
|
|
s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny<int>()))
|
2011-09-14 07:37:22 +03:00
|
|
|
.Returns(false);
|
|
|
|
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
bool result = Subject.IsSatisfiedBy(parseResultMulti);
|
|
|
|
|
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
result.Should().BeTrue();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IsAcceptableSize_true_multi_episode_not_first_or_last_60_minute()
|
|
|
|
{
|
2013-04-28 22:46:13 +03:00
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
|
|
|
|
parseResultMulti.Series = series60minutes;
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultMulti.Report.Size = 368572800;
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-27 06:32:22 +03:00
|
|
|
Mocker.GetMock<IQualitySizeService>().Setup(s => s.Get(1)).Returns(qualityType);
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-22 03:47:09 +03:00
|
|
|
Mocker.GetMock<IEpisodeService>().Setup(
|
2013-04-15 04:41:39 +03:00
|
|
|
s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny<int>()))
|
2011-09-14 07:37:22 +03:00
|
|
|
.Returns(false);
|
|
|
|
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
bool result = Subject.IsSatisfiedBy(parseResultMulti);
|
|
|
|
|
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
result.Should().BeTrue();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IsAcceptableSize_false_multi_episode_not_first_or_last_30_minute()
|
|
|
|
{
|
2013-04-28 22:46:13 +03:00
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
|
|
|
|
parseResultMulti.Series = series30minutes;
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultMulti.Report.Size = 1.Gigabytes();
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-27 06:32:22 +03:00
|
|
|
Mocker.GetMock<IQualitySizeService>().Setup(s => s.Get(1)).Returns(qualityType);
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-22 03:47:09 +03:00
|
|
|
Mocker.GetMock<IEpisodeService>().Setup(
|
2013-04-15 04:41:39 +03:00
|
|
|
s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny<int>()))
|
2011-09-14 07:37:22 +03:00
|
|
|
.Returns(false);
|
|
|
|
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
bool result = Subject.IsSatisfiedBy(parseResultMulti);
|
|
|
|
|
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
result.Should().BeFalse();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IsAcceptableSize_false_multi_episode_not_first_or_last_60_minute()
|
|
|
|
{
|
2013-04-28 22:46:13 +03:00
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
|
|
|
|
parseResultMulti.Series = series60minutes;
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultMulti.Report.Size = 10.Gigabytes();
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-27 06:32:22 +03:00
|
|
|
Mocker.GetMock<IQualitySizeService>().Setup(s => s.Get(1)).Returns(qualityType);
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-22 03:47:09 +03:00
|
|
|
Mocker.GetMock<IEpisodeService>().Setup(
|
2013-04-15 04:41:39 +03:00
|
|
|
s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny<int>()))
|
2011-09-14 07:37:22 +03:00
|
|
|
.Returns(false);
|
|
|
|
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
bool result = Subject.IsSatisfiedBy(parseResultMulti);
|
|
|
|
|
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
result.Should().BeFalse();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IsAcceptableSize_true_single_episode_first_30_minute()
|
|
|
|
{
|
2013-04-28 22:46:13 +03:00
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
|
|
|
|
parseResultSingle.Series = series30minutes;
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultSingle.Report.Size = 184572800;
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-27 06:32:22 +03:00
|
|
|
Mocker.GetMock<IQualitySizeService>().Setup(s => s.Get(1)).Returns(qualityType);
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-22 03:47:09 +03:00
|
|
|
Mocker.GetMock<IEpisodeService>().Setup(
|
2013-04-15 04:41:39 +03:00
|
|
|
s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny<int>()))
|
2011-09-14 07:37:22 +03:00
|
|
|
.Returns(true);
|
|
|
|
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
bool result = Subject.IsSatisfiedBy(parseResultSingle);
|
|
|
|
|
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
result.Should().BeTrue();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IsAcceptableSize_true_single_episode_first_60_minute()
|
|
|
|
{
|
2013-04-28 22:46:13 +03:00
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
|
|
|
|
parseResultSingle.Series = series60minutes;
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultSingle.Report.Size = 368572800;
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-27 06:32:22 +03:00
|
|
|
Mocker.GetMock<IQualitySizeService>().Setup(s => s.Get(1)).Returns(qualityType);
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-22 03:47:09 +03:00
|
|
|
Mocker.GetMock<IEpisodeService>().Setup(
|
2013-04-15 04:41:39 +03:00
|
|
|
s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny<int>()))
|
2011-09-14 07:37:22 +03:00
|
|
|
.Returns(true);
|
|
|
|
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
bool result = Subject.IsSatisfiedBy(parseResultSingle);
|
|
|
|
|
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
result.Should().BeTrue();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IsAcceptableSize_false_single_episode_first_30_minute()
|
|
|
|
{
|
2013-04-28 22:46:13 +03:00
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
|
|
|
|
parseResultSingle.Series = series30minutes;
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultSingle.Report.Size = 1.Gigabytes();
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-27 06:32:22 +03:00
|
|
|
Mocker.GetMock<IQualitySizeService>().Setup(s => s.Get(1)).Returns(qualityType);
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-22 03:47:09 +03:00
|
|
|
Mocker.GetMock<IEpisodeService>().Setup(
|
2013-04-15 04:41:39 +03:00
|
|
|
s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny<int>()))
|
2011-09-14 07:37:22 +03:00
|
|
|
.Returns(true);
|
|
|
|
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
bool result = Subject.IsSatisfiedBy(parseResultSingle);
|
|
|
|
|
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
result.Should().BeFalse();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IsAcceptableSize_false_single_episode_first_60_minute()
|
|
|
|
{
|
2013-04-28 22:46:13 +03:00
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
|
|
|
|
parseResultSingle.Series = series60minutes;
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultSingle.Report.Size = 10.Gigabytes();
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-27 06:32:22 +03:00
|
|
|
Mocker.GetMock<IQualitySizeService>().Setup(s => s.Get(1)).Returns(qualityType);
|
2011-09-14 07:37:22 +03:00
|
|
|
|
2013-02-22 03:47:09 +03:00
|
|
|
Mocker.GetMock<IEpisodeService>().Setup(
|
2013-04-15 04:41:39 +03:00
|
|
|
s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny<int>()))
|
2011-09-14 07:37:22 +03:00
|
|
|
.Returns(true);
|
|
|
|
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
bool result = Subject.IsSatisfiedBy(parseResultSingle);
|
|
|
|
|
|
|
|
|
2011-09-14 07:37:22 +03:00
|
|
|
result.Should().BeFalse();
|
|
|
|
}
|
2011-09-16 07:42:30 +03:00
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IsAcceptableSize_true_unlimited_30_minute()
|
|
|
|
{
|
2013-04-28 22:46:13 +03:00
|
|
|
|
2011-09-16 07:42:30 +03:00
|
|
|
|
|
|
|
parseResultSingle.Series = series30minutes;
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultSingle.Report.Size = 18457280000;
|
2011-09-16 07:42:30 +03:00
|
|
|
qualityType.MaxSize = 0;
|
|
|
|
|
2013-02-27 06:32:22 +03:00
|
|
|
Mocker.GetMock<IQualitySizeService>().Setup(s => s.Get(1)).Returns(qualityType);
|
2011-09-16 07:42:30 +03:00
|
|
|
|
2013-02-22 03:47:09 +03:00
|
|
|
Mocker.GetMock<IEpisodeService>().Setup(
|
2013-04-15 04:41:39 +03:00
|
|
|
s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny<int>()))
|
2011-09-16 07:42:30 +03:00
|
|
|
.Returns(true);
|
|
|
|
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
bool result = Subject.IsSatisfiedBy(parseResultSingle);
|
|
|
|
|
|
|
|
|
2011-09-16 07:42:30 +03:00
|
|
|
result.Should().BeTrue();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IsAcceptableSize_true_unlimited_60_minute()
|
|
|
|
{
|
2013-04-28 22:46:13 +03:00
|
|
|
|
2011-09-16 07:42:30 +03:00
|
|
|
|
|
|
|
parseResultSingle.Series = series60minutes;
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultSingle.Report.Size = 36857280000;
|
2011-09-16 07:42:30 +03:00
|
|
|
qualityType.MaxSize = 0;
|
|
|
|
|
2013-02-27 06:32:22 +03:00
|
|
|
Mocker.GetMock<IQualitySizeService>().Setup(s => s.Get(1)).Returns(qualityType);
|
2011-09-16 07:42:30 +03:00
|
|
|
|
2013-02-22 03:47:09 +03:00
|
|
|
Mocker.GetMock<IEpisodeService>().Setup(
|
2013-04-15 04:41:39 +03:00
|
|
|
s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny<int>()))
|
2011-09-16 07:42:30 +03:00
|
|
|
.Returns(true);
|
|
|
|
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
bool result = Subject.IsSatisfiedBy(parseResultSingle);
|
|
|
|
|
|
|
|
|
2011-09-16 07:42:30 +03:00
|
|
|
result.Should().BeTrue();
|
|
|
|
}
|
2011-12-01 08:08:36 +03:00
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IsAcceptableSize_should_treat_daily_series_as_single_episode()
|
|
|
|
{
|
2013-04-15 04:41:39 +03:00
|
|
|
|
2011-12-01 08:08:36 +03:00
|
|
|
parseResultSingle.Series = series60minutes;
|
2013-04-15 04:41:39 +03:00
|
|
|
parseResultSingle.Series.SeriesType = SeriesTypes.Daily;
|
|
|
|
|
|
|
|
parseResultSingle.Report.Size = 300.Megabytes();
|
2011-12-01 08:08:36 +03:00
|
|
|
|
|
|
|
qualityType.MaxSize = (int)600.Megabytes();
|
|
|
|
|
2013-02-27 06:32:22 +03:00
|
|
|
Mocker.GetMock<IQualitySizeService>().Setup(s => s.Get(1)).Returns(qualityType);
|
2011-12-01 08:08:36 +03:00
|
|
|
|
2013-02-22 03:47:09 +03:00
|
|
|
Mocker.GetMock<IEpisodeService>().Setup(
|
2013-04-15 04:41:39 +03:00
|
|
|
s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny<int>()))
|
2011-12-01 08:08:36 +03:00
|
|
|
.Returns(true);
|
|
|
|
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
bool result = Subject.IsSatisfiedBy(parseResultSingle);
|
|
|
|
|
|
|
|
|
2011-12-01 08:08:36 +03:00
|
|
|
result.Should().BeTrue();
|
|
|
|
}
|
2013-01-09 11:15:06 +03:00
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void should_return_true_if_RAWHD()
|
|
|
|
{
|
2013-04-15 04:41:39 +03:00
|
|
|
var parseResult = new RemoteEpisode
|
2013-01-09 11:15:06 +03:00
|
|
|
{
|
2013-04-28 22:46:13 +03:00
|
|
|
ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.RAWHD, false) },
|
2013-01-09 11:15:06 +03:00
|
|
|
};
|
|
|
|
|
2013-04-15 04:41:39 +03:00
|
|
|
Subject.IsSatisfiedBy(parseResult).Should().BeTrue();
|
2013-01-09 11:15:06 +03:00
|
|
|
}
|
2011-09-14 07:37:22 +03:00
|
|
|
}
|
|
|
|
}
|