mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
Added NzbInfoUrl to indexers.
This commit is contained in:
parent
ce0a6f8b86
commit
b314ff5e82
13 changed files with 113 additions and 4 deletions
|
@ -26,7 +26,6 @@ namespace NzbDrone.Core.Test
|
|||
// ReSharper disable InconsistentNaming
|
||||
public class IndexerTests : CoreTest
|
||||
{
|
||||
|
||||
[TestCase("nzbsorg.xml")]
|
||||
[TestCase("nzbsrus.xml")]
|
||||
[TestCase("newzbin.xml")]
|
||||
|
@ -563,5 +562,39 @@ namespace NzbDrone.Core.Test
|
|||
|
||||
Thread.CurrentThread.CurrentCulture = currentCulture;
|
||||
}
|
||||
|
||||
[TestCase("nzbsorg.xml", "info")]
|
||||
[TestCase("nzbsrus.xml", "info")]
|
||||
[TestCase("newzbin.xml", "info")]
|
||||
[TestCase("nzbmatrix.xml", "info")]
|
||||
[TestCase("newznab.xml", "info")]
|
||||
[TestCase("wombles.xml", "info")]
|
||||
[TestCase("filesharingtalk.xml", "info")]
|
||||
[TestCase("nzbindex.xml", "info")]
|
||||
[TestCase("nzbclub.xml", "info")]
|
||||
public void NzbInfoUrl_should_contain_information_string(string fileName, string expectedContent)
|
||||
{
|
||||
Mocker.GetMock<HttpProvider>()
|
||||
.Setup(h => h.DownloadStream(It.IsAny<String>(), It.IsAny<NetworkCredential>()))
|
||||
.Returns(File.OpenRead(".\\Files\\Rss\\" + fileName));
|
||||
|
||||
var fakeSettings = Builder<IndexerDefinition>.CreateNew().Build();
|
||||
Mocker.GetMock<IndexerProvider>()
|
||||
.Setup(c => c.GetSettings(It.IsAny<Type>()))
|
||||
.Returns(fakeSettings);
|
||||
|
||||
var mockIndexer = Mocker.Resolve<MockIndexer>();
|
||||
var parseResults = mockIndexer.FetchRss();
|
||||
|
||||
foreach (var episodeParseResult in parseResults)
|
||||
{
|
||||
episodeParseResult.NzbInfoUrl.Should().Contain(expectedContent);
|
||||
}
|
||||
|
||||
parseResults.Should().NotBeEmpty();
|
||||
parseResults.Should().OnlyContain(s => s.Indexer == mockIndexer.Name);
|
||||
parseResults.Should().OnlyContain(s => !String.IsNullOrEmpty(s.OriginalString));
|
||||
parseResults.Should().OnlyContain(s => s.Age >= 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue