New: Drone now uses the Download Client API to determine if a download is ready for import. (User configuration is required to replace the drone factory with this feature)

This commit is contained in:
Taloth Saldono
2014-04-19 17:09:22 +02:00
parent dcb586b937
commit 2035fe8578
196 changed files with 3961 additions and 2223 deletions
@@ -29,37 +29,6 @@ namespace NzbDrone.Core.Test.IndexerTests
Mocker.SetConstant<IEnumerable<IIndexer>>(_indexers);
}
[Test]
public void should_create_default_indexer_on_startup()
{
IList<IndexerDefinition> storedIndexers = null;
Mocker.GetMock<IIndexerRepository>()
.Setup(c => c.InsertMany(It.IsAny<IList<IndexerDefinition>>()))
.Callback<IList<IndexerDefinition>>(indexers => storedIndexers = indexers);
Subject.Handle(new ApplicationStartedEvent());
storedIndexers.Should().NotBeEmpty();
storedIndexers.Select(c => c.Name).Should().OnlyHaveUniqueItems();
storedIndexers.Select(c => c.Enable).Should().NotBeEmpty();
storedIndexers.Select(c => c.Implementation).Should().NotContainNulls();
}
[Test]
public void getting_list_of_indexers()
{
Mocker.SetConstant<IIndexerRepository>(Mocker.Resolve<IndexerRepository>());
Subject.Handle(new ApplicationStartedEvent());
var indexers = Subject.All().ToList();
indexers.Should().NotBeEmpty();
indexers.Should().NotContain(c => c.Settings == null);
indexers.Should().NotContain(c => c.Name == null);
indexers.Select(c => c.Name).Should().OnlyHaveUniqueItems();
}
[Test]
public void should_remove_missing_indexers_on_startup()
{
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using FluentAssertions;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers.Eztv;
using NzbDrone.Core.Indexers.Newznab;
using NzbDrone.Core.Indexers.Wombles;
using NzbDrone.Core.Parser.Model;
@@ -37,39 +36,6 @@ namespace NzbDrone.Core.Test.IndexerTests.IntegrationTests
ValidateResult(result, skipSize: true, skipInfo: true);
}
[Test]
public void extv_rss()
{
var indexer = new Eztv();
indexer.Definition = new IndexerDefinition
{
Name = "Eztv",
Settings = NullConfig.Instance
};
var result = Subject.FetchRss(indexer);
ValidateTorrentResult(result, skipSize: false, skipInfo: true);
}
[Test]
public void nzbsorg_rss()
{
var indexer = new Newznab();
indexer.Definition = new IndexerDefinition();
indexer.Definition.Name = "nzbs.org";
indexer.Definition.Settings = new NewznabSettings
{
ApiKey = "64d61d3cfd4b75e51d01cbc7c6a78275",
Url = "http://nzbs.org"
};
var result = Subject.FetchRss(indexer);
ValidateResult(result);
}
private void ValidateResult(IList<ReleaseInfo> reports, bool skipSize = false, bool skipInfo = false)
{
@@ -41,7 +41,7 @@ namespace NzbDrone.Core.Test.IndexerTests
indexer.Setup(s => s.GetSeasonSearchUrls(It.IsAny<String>(), It.IsAny<Int32>(), It.IsAny<Int32>(), It.IsAny<Int32>()))
.Returns(new List<string> { "http://www.nzbdrone.com" });
indexer.SetupGet(s => s.SupportsPaging).Returns(paging);
indexer.SetupGet(s => s.SupportedPageSize).Returns(paging ? 100 : 0);
var definition = new IndexerDefinition();
definition.Name = "Test";