New: Added NzbIndex.nl as an indexer, enabled by default

This commit is contained in:
Mark McDowall 2012-04-14 16:37:36 -07:00
commit 3a8f40511d
9 changed files with 1179 additions and 1 deletions

View file

@ -33,6 +33,7 @@ namespace NzbDrone.Core.Test
[TestCase("newznab.xml")]
[TestCase("wombles.xml")]
[TestCase("filesharingtalk.xml")]
[TestCase("nzbindex.xml")]
public void parse_feed_xml(string fileName)
{
Mocker.GetMock<HttpProvider>()
@ -383,6 +384,22 @@ namespace NzbDrone.Core.Test
parseResults[0].Size.Should().Be(1183105773);
}
[Test]
public void size_nzbindex()
{
WithConfiguredIndexers();
Mocker.GetMock<HttpProvider>()
.Setup(h => h.DownloadStream(It.IsAny<String>(), It.IsAny<NetworkCredential>()))
.Returns(File.OpenRead(".\\Files\\Rss\\SizeParsing\\nzbindex.xml"));
//Act
var parseResults = Mocker.Resolve<NzbIndex>().FetchRss();
parseResults.Should().HaveCount(1);
parseResults[0].Size.Should().Be(587328389);
}
[Test]
public void Server_Unavailable_503_should_not_log_exception()
{
@ -467,5 +484,21 @@ namespace NzbDrone.Core.Test
ExceptionVerification.MarkInconclusive("(503) Server Unavailable.");
ExceptionVerification.MarkInconclusive("(500) Internal Server Error.");
}
[Test]
public void title_preparse_nzbindex()
{
WithConfiguredIndexers();
Mocker.GetMock<HttpProvider>()
.Setup(h => h.DownloadStream(It.IsAny<String>(), It.IsAny<NetworkCredential>()))
.Returns(File.OpenRead(".\\Files\\Rss\\SizeParsing\\nzbindex.xml"));
//Act
var parseResults = Mocker.Resolve<NzbIndex>().FetchRss();
parseResults.Should().HaveCount(1);
parseResults[0].CleanTitle.Should().Be("britainsgotmoretalent");
}
}
}