Implement Release Parsing, Decision Engine, and Downloading (#35)

* Implement Parsing, Decision Engine, and Downloading
This commit is contained in:
Qstick
2017-08-13 22:58:42 -04:00
committed by GitHub
parent 5556989324
commit 1e4d9480e9
191 changed files with 2604 additions and 2755 deletions
@@ -2,7 +2,6 @@
using NUnit.Framework;
using NzbDrone.Core.DecisionEngine.Specifications;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Indexers;
@@ -12,12 +11,12 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
public class RawDiskSpecificationFixture : CoreTest<RawDiskSpecification>
{
private RemoteEpisode _remoteEpisode;
private RemoteAlbum _remoteAlbum;
[SetUp]
public void Setup()
{
_remoteEpisode = new RemoteEpisode
_remoteAlbum = new RemoteAlbum
{
Release = new ReleaseInfo() { DownloadProtocol = DownloadProtocol.Torrent }
};
@@ -25,48 +24,41 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
private void WithContainer(string container)
{
_remoteEpisode.Release.Container = container;
_remoteAlbum.Release.Container = container;
}
[Test]
public void should_return_true_if_no_container_specified()
{
Subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_remoteAlbum, null).Accepted.Should().BeTrue();
}
[Test]
public void should_return_true_if_mkv()
public void should_return_true_if_flac()
{
WithContainer("MKV");
Subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeTrue();
WithContainer("FLAC");
Subject.IsSatisfiedBy(_remoteAlbum, null).Accepted.Should().BeTrue();
}
[Test]
public void should_return_false_if_vob()
{
WithContainer("VOB");
Subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeFalse();
Subject.IsSatisfiedBy(_remoteAlbum, null).Accepted.Should().BeFalse();
}
[Test]
public void should_return_false_if_iso()
{
WithContainer("ISO");
Subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeFalse();
}
[Test]
public void should_return_false_if_m2ts()
{
WithContainer("M2TS");
Subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeFalse();
Subject.IsSatisfiedBy(_remoteAlbum, null).Accepted.Should().BeFalse();
}
[Test]
public void should_compare_case_insensitive()
{
WithContainer("vob");
Subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeFalse();
Subject.IsSatisfiedBy(_remoteAlbum, null).Accepted.Should().BeFalse();
}
}