Fixed: EzRSS Size Parsing

This commit is contained in:
Keivan Beigi
2014-11-24 15:16:29 -08:00
parent d30eb1b306
commit 23524c238f
7 changed files with 42 additions and 56 deletions
@@ -175,6 +175,22 @@ namespace NzbDrone.Core.Test.IndexerTests.IntegrationTests
ValidateTorrentResult(result, hasSize: true);
}
private void ValidateTorrentResult(IList<ReleaseInfo> reports, bool hasSize = false, bool hasInfoUrl = false, bool hasMagnet = false)
{
reports.Should().OnlyContain(c => c.GetType() == typeof(TorrentInfo));
ValidateResult(reports, hasSize, hasInfoUrl);
reports.Should().OnlyContain(c => c.DownloadProtocol == DownloadProtocol.Torrent);
if (hasMagnet)
{
reports.Cast<TorrentInfo>().Should().OnlyContain(c => c.MagnetUrl.StartsWith("magnet:"));
}
}
private void ValidateResult(IList<ReleaseInfo> reports, bool hasSize = false, bool hasInfoUrl = false)
{
reports.Should().NotBeEmpty();
@@ -194,19 +210,5 @@ namespace NzbDrone.Core.Test.IndexerTests.IntegrationTests
}
}
private void ValidateTorrentResult(IList<ReleaseInfo> reports, bool hasSize = false, bool hasInfoUrl = false, bool hasMagnet = false)
{
reports.Should().OnlyContain(c => c.GetType() == typeof(TorrentInfo));
ValidateResult(reports, hasSize, hasInfoUrl);
reports.Should().OnlyContain(c => c.DownloadProtocol == DownloadProtocol.Torrent);
if (hasMagnet)
{
reports.Cast<TorrentInfo>().Should().OnlyContain(c => c.MagnetUrl.StartsWith("magnet:"));
}
}
}
}