mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-24 22:35:39 -04:00
Added RSS support for torrents
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using FluentAssertions;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Indexers.Eztv;
|
||||
using NzbDrone.Core.Indexers.Newznab;
|
||||
using NzbDrone.Core.Indexers.NzbClub;
|
||||
using NzbDrone.Core.Indexers.Wombles;
|
||||
@@ -8,6 +9,7 @@ using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Test.Common.Categories;
|
||||
using System.Linq;
|
||||
|
||||
namespace NzbDrone.Core.Test.IndexerTests.IntegrationTests
|
||||
{
|
||||
@@ -43,6 +45,17 @@ namespace NzbDrone.Core.Test.IndexerTests.IntegrationTests
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void extv_rss()
|
||||
{
|
||||
var indexer = new Eztv();
|
||||
|
||||
var result = Subject.FetchRss(indexer);
|
||||
|
||||
ValidateTorrentResult(result, skipSize: false, skipInfo: true);
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void nzbsorg_rss()
|
||||
{
|
||||
@@ -63,15 +76,17 @@ namespace NzbDrone.Core.Test.IndexerTests.IntegrationTests
|
||||
|
||||
|
||||
|
||||
private void ValidateResult(IList<ReportInfo> reports, bool skipSize = false, bool skipInfo = false)
|
||||
private void ValidateResult(IList<ReleaseInfo> reports, bool skipSize = false, bool skipInfo = false)
|
||||
{
|
||||
reports.Should().NotBeEmpty();
|
||||
reports.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.Title));
|
||||
reports.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.NzbUrl));
|
||||
reports.Should().NotContain(c => string.IsNullOrWhiteSpace(c.Title));
|
||||
reports.Should().NotContain(c => string.IsNullOrWhiteSpace(c.DownloadUrl));
|
||||
reports.Should().OnlyContain(c => c.PublishDate.Year > 2000);
|
||||
reports.Should().OnlyContain(c => c.DownloadUrl.StartsWith("http"));
|
||||
|
||||
if (!skipInfo)
|
||||
{
|
||||
reports.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.NzbInfoUrl));
|
||||
reports.Should().NotContain(c => string.IsNullOrWhiteSpace(c.InfoUrl));
|
||||
}
|
||||
|
||||
if (!skipSize)
|
||||
@@ -80,5 +95,18 @@ namespace NzbDrone.Core.Test.IndexerTests.IntegrationTests
|
||||
}
|
||||
}
|
||||
|
||||
private void ValidateTorrentResult(IList<ReleaseInfo> reports, bool skipSize = false, bool skipInfo = false)
|
||||
{
|
||||
|
||||
reports.Should().OnlyContain(c => c.GetType() == typeof(TorrentInfo));
|
||||
|
||||
ValidateResult(reports, skipSize, skipInfo);
|
||||
|
||||
reports.Should().OnlyContain(c => c.DownloadUrl.EndsWith(".torrent"));
|
||||
|
||||
reports.Cast<TorrentInfo>().Should().OnlyContain(c => c.MagnetUrl.StartsWith("magnet:"));
|
||||
reports.Cast<TorrentInfo>().Should().NotContain(c => string.IsNullOrWhiteSpace(c.InfoHash));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user