Merge branch 'torrentrss' into develop

This commit is contained in:
Taloth Saldono
2015-05-27 08:03:04 +02:00
61 changed files with 2339 additions and 2023 deletions
@@ -27,7 +27,7 @@ namespace NzbDrone.Core.Test.IndexerTests.BitMeTvTests
[Test]
public void should_parse_recent_feed_from_BitMeTv()
{
var recentFeed = ReadAllText(@"Files/RSS/BitMeTv.xml");
var recentFeed = ReadAllText(@"Files/Indexers/BitMeTv/BitMeTv.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
@@ -27,7 +27,7 @@ namespace NzbDrone.Core.Test.IndexerTests.EztvTests
[Test]
public void should_parse_recent_feed_from_Eztv()
{
var recentFeed = ReadAllText(@"Files/RSS/Eztv.xml");
var recentFeed = ReadAllText(@"Files/Indexers/Eztv/Eztv.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
@@ -27,7 +27,7 @@ namespace NzbDrone.Core.Test.IndexerTests.FanzubTests
[Test]
public void should_parse_recent_feed_from_fanzub()
{
var recentFeed = ReadAllText(@"Files/RSS/fanzub.xml");
var recentFeed = ReadAllText(@"Files/Indexers/Fanzub/fanzub.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
@@ -27,7 +27,7 @@ namespace NzbDrone.Core.Test.IndexerTests.IPTorrentsTests
[Test]
public void should_parse_recent_feed_from_IPTorrents()
{
var recentFeed = ReadAllText(@"Files/RSS/IPTorrents.xml");
var recentFeed = ReadAllText(@"Files/Indexers/IPTorrents/IPTorrents.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
@@ -28,7 +28,7 @@ namespace NzbDrone.Core.Test.IndexerTests.KickassTorrentsTests
[Test]
public void should_parse_recent_feed_from_KickassTorrents()
{
var recentFeed = ReadAllText(@"Files/RSS/KickassTorrents.xml");
var recentFeed = ReadAllText(@"Files/Indexers/KickassTorrents/KickassTorrents.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
@@ -74,7 +74,7 @@ namespace NzbDrone.Core.Test.IndexerTests.KickassTorrentsTests
{
((KickassTorrentsSettings) Subject.Definition.Settings).VerifiedOnly = true;
var recentFeed = ReadAllText(@"Files/RSS/KickassTorrents.xml");
var recentFeed = ReadAllText(@"Files/Indexers/KickassTorrents/KickassTorrents.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
@@ -30,7 +30,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
[Test]
public void should_parse_recent_feed_from_newznab_nzb_su()
{
var recentFeed = ReadAllText(@"Files/RSS/newznab_nzb_su.xml");
var recentFeed = ReadAllText(@"Files/Indexers/Newznab/newznab_nzb_su.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
@@ -27,7 +27,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NyaaTests
[Test]
public void should_parse_recent_feed_from_Nyaa()
{
var recentFeed = ReadAllText(@"Files/RSS/Nyaa.xml");
var recentFeed = ReadAllText(@"Files/Indexers/Nyaa/Nyaa.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
@@ -30,7 +30,7 @@ namespace NzbDrone.Core.Test.IndexerTests.OmgwtfnzbsTests
[Test]
public void should_parse_recent_feed_from_omgwtfnzbs()
{
var recentFeed = ReadAllText(@"Files/RSS/omgwtfnzbs.xml");
var recentFeed = ReadAllText(@"Files/Indexers/Omgwtfnzbs/Omgwtfnzbs.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
@@ -0,0 +1,60 @@
using System.Collections.Generic;
using FluentValidation.Results;
using NLog;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers.TorrentRss;
using NzbDrone.Core.Parser;
using NLog.Config;
using NLog.Targets;
namespace NzbDrone.Core.Test.IndexerTests.TorrentRssIndexerTests
{
public class TestTorrentRssIndexer : TorrentRssIndexer
{
public TestTorrentRssIndexer(IHttpClient httpClient, IConfigService configService, IParsingService parsingService, ITorrentRssParserFactory torrentRssParserFactory, Logger logger)
: base(httpClient, configService, parsingService, torrentRssParserFactory, logger)
{
}
public List<ValidationFailure> TestPublic()
{
var result = new List<ValidationFailure>();
this.SetupNLog(); // Enable this to enable trace logging with nlog for debugging purposes
Test(result);
return result;
}
/// <summary>
/// Code to quickly debug unit tests
/// </summary>
private void SetupNLog()
{
// Step 1. Create configuration object
var config = new LoggingConfiguration();
var fileTarget = new FileTarget();
config.AddTarget("file", fileTarget);
// Step 3. Set target properties
fileTarget.FileName = "${basedir}/log.txt";
fileTarget.Layout = GetStandardLayout();
// Step 4. Define rules
var rule1 = new LoggingRule("*", LogLevel.Trace, fileTarget);
config.LoggingRules.Add(rule1);
// Step 5. Activate the configuration
LogManager.Configuration = config;
}
private static string GetStandardLayout()
{
return @"${date:universalTime=true:format=u}|" + "${processid:fixedLength=True:padding=4:padCharacter= }|"
+ "${threadid:fixedLength=True:padding=3:padCharacter= }|" + "${level:fixedLength=True:padding=5:padCharacter= :upperCase=True}|"
+ "${callsite:fileName=True:className=False:methodName=True:includeSourcePath=False:padding=50:padCharacter= }|" + "${message}"
+ " ${exception:maxInnerExceptionLevel=3:format=Method,Message,StackTrace:innerFormat=Method,Message,StackTrace:separator=\r\n:innerExceptionSeparator=\r\n}";
}
}
}
@@ -0,0 +1,127 @@
using System;
using System.Linq;
using FluentAssertions;
using Moq;
using NLog;
using NUnit.Framework;
using NzbDrone.Common.Cache;
using NzbDrone.Common.Http;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers.TorrentRss;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.IndexerTests.TorrentRssIndexerTests
{
[TestFixture]
public class TorrentRssIndexerFixture : CoreTest<TestTorrentRssIndexer>
{
private const string _indexerUrl = "http://my.indexer.tv/recent";
[SetUp]
public void Setup()
{
Mocker.SetConstant<IHttpClient>(Mocker.GetMock<IHttpClient>().Object);
Mocker.SetConstant<ICacheManager>(Mocker.Resolve<CacheManager>());
Mocker.SetConstant<ITorrentRssSettingsDetector>(Mocker.Resolve<TorrentRssSettingsDetector>());
Mocker.SetConstant<ITorrentRssParserFactory>(Mocker.Resolve<TorrentRssParserFactory>());
Subject.Definition = new IndexerDefinition()
{
Name = "TorrentRssIndexer",
Settings = new TorrentRssIndexerSettings() { BaseUrl = _indexerUrl },
};
}
private void GivenRecentFeedResponse(string rssXmlFile)
{
var recentFeed = ReadAllText(@"Files/Indexers/" + rssXmlFile);
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.IsAny<HttpRequest>()))
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), recentFeed));
}
[Test]
public void should_parse_recent_feed_from_ImmortalSeed()
{
GivenRecentFeedResponse("TorrentRss/ImmortalSeed.xml");
var releases = Subject.FetchRecent();
releases.Should().HaveCount(50);
releases.First().Should().BeOfType<TorrentInfo>();
var torrentInfo = (TorrentInfo)releases.First();
torrentInfo.Title.Should().Be("Conan.2015.02.05.Jeff.Bridges.720p.HDTV.X264-CROOKS");
torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent);
torrentInfo.DownloadUrl.Should().Be("https://immortalseed.me/download.php?type=rss&secret_key=12345678910&id=374534");
torrentInfo.InfoUrl.Should().BeNullOrEmpty();
torrentInfo.CommentUrl.Should().BeNullOrEmpty();
torrentInfo.Indexer.Should().Be(Subject.Definition.Name);
torrentInfo.PublishDate.Should().Be(DateTime.Parse("2015-02-06 13:32:26"));
torrentInfo.Size.Should().Be(984078090);
torrentInfo.InfoHash.Should().BeNullOrEmpty();
torrentInfo.MagnetUrl.Should().BeNullOrEmpty();
torrentInfo.Peers.Should().Be(8);
torrentInfo.Seeders.Should().Be(6);
}
[Test]
public void should_parse_recent_feed_from_Eztv()
{
GivenRecentFeedResponse("Eztv/Eztv.xml");
var releases = Subject.FetchRecent();
releases.Should().HaveCount(3);
releases.First().Should().BeOfType<TorrentInfo>();
var torrentInfo = releases.First() as TorrentInfo;
torrentInfo.Title.Should().Be("S4C I Grombil Cyfandir Pell American Interior [PDTV - MVGROUP]");
torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent);
torrentInfo.DownloadUrl.Should().Be("http://re.zoink.it/20a4ed4eFC");
torrentInfo.InfoUrl.Should().Be("http://eztv.it/ep/58439/s4c-i-grombil-cyfandir-pell-american-interior-pdtv-x264-mvgroup/");
torrentInfo.CommentUrl.Should().Be("http://eztv.it/forum/discuss/58439/");
torrentInfo.Indexer.Should().Be(Subject.Definition.Name);
torrentInfo.PublishDate.Should().Be(DateTime.Parse("2014/09/15 18:39:00"));
torrentInfo.Size.Should().Be(796606175);
torrentInfo.InfoHash.Should().Be("20FC4FBFA88272274AC671F857CC15144E9AA83E");
torrentInfo.MagnetUrl.Should().Be("magnet:?xt=urn:btih:ED6E7P5IQJZCOSWGOH4FPTAVCRHJVKB6&dn=S4C.I.Grombil.Cyfandir.Pell.American.Interior.PDTV.x264-MVGroup");
torrentInfo.Peers.Should().NotHaveValue();
torrentInfo.Seeders.Should().NotHaveValue();
}
[Test]
public void should_parse_recent_feed_from_ShowRSS_info()
{
Subject.Definition.Settings.As<TorrentRssIndexerSettings>().AllowZeroSize = true;
GivenRecentFeedResponse("TorrentRss/ShowRSS.info.xml");
var releases = Subject.FetchRecent();
releases.Should().HaveCount(5);
releases.First().Should().BeOfType<TorrentInfo>();
var torrentInfo = releases.First() as TorrentInfo;
torrentInfo.Title.Should().Be("The Voice 8x25");
torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent);
torrentInfo.DownloadUrl.Should().Be("magnet:?xt=urn:btih:96CD620BEDA3EFD7C4D7746EF94549D03A2EB13B&dn=The+Voice+S08E25+WEBRip+x264+WNN&tr=udp://tracker.coppersurfer.tk:6969/announce&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://open.demonii.com:1337");
torrentInfo.InfoUrl.Should().BeNullOrEmpty();
torrentInfo.CommentUrl.Should().BeNullOrEmpty();
torrentInfo.Indexer.Should().Be(Subject.Definition.Name);
torrentInfo.PublishDate.Should().Be(DateTime.Parse("2015/05/15 08:30:01"));
torrentInfo.Size.Should().Be(0);
torrentInfo.InfoHash.Should().Be("96CD620BEDA3EFD7C4D7746EF94549D03A2EB13B");
torrentInfo.MagnetUrl.Should().Be("magnet:?xt=urn:btih:96CD620BEDA3EFD7C4D7746EF94549D03A2EB13B&dn=The+Voice+S08E25+WEBRip+x264+WNN&tr=udp://tracker.coppersurfer.tk:6969/announce&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://open.demonii.com:1337");
torrentInfo.Peers.Should().NotHaveValue();
torrentInfo.Seeders.Should().NotHaveValue();
}
}
}
@@ -0,0 +1,168 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Cache;
using NzbDrone.Core.Indexers.TorrentRss;
using NzbDrone.Core.Test.Framework;
using FluentAssertions;
using NzbDrone.Core.Indexers.Exceptions;
using NzbDrone.Core.Indexers;
namespace NzbDrone.Core.Test.IndexerTests.TorrentRssIndexerTests
{
[TestFixture]
public class TorrentRssParserFactoryFixture : CoreTest<TorrentRssParserFactory>
{
private TorrentRssIndexerSettings _indexerSettings1;
private TorrentRssIndexerSettings _indexerSettings2;
private TorrentRssIndexerSettings _indexerSettings3;
[SetUp]
public void SetUp()
{
Mocker.SetConstant<ICacheManager>(Mocker.Resolve<CacheManager>());
_indexerSettings1 = new TorrentRssIndexerSettings
{
BaseUrl = "http://my.indexer.com/"
};
_indexerSettings2 = new TorrentRssIndexerSettings
{
BaseUrl = "http://my.other.indexer.com/"
};
_indexerSettings3 = new TorrentRssIndexerSettings
{
BaseUrl = "http://my.indexer.com/",
AllowZeroSize = true
};
}
private void GivenSuccessful(TorrentRssIndexerParserSettings parserSettings = null)
{
if (parserSettings == null)
{
parserSettings = new TorrentRssIndexerParserSettings
{
UseEnclosureLength = true,
ParseSizeInDescription = false
};
}
Mocker.GetMock<ITorrentRssSettingsDetector>()
.Setup(v => v.Detect(It.IsAny<TorrentRssIndexerSettings>()))
.Returns(parserSettings);
}
private void GivenFailed()
{
Mocker.GetMock<ITorrentRssSettingsDetector>()
.Setup(v => v.Detect(It.IsAny<TorrentRssIndexerSettings>()))
.Returns((TorrentRssIndexerParserSettings)null);
}
private void VerifyDetectionCount(int count)
{
Mocker.GetMock<ITorrentRssSettingsDetector>()
.Verify(v => v.Detect(It.IsAny<TorrentRssIndexerSettings>()), Times.Exactly(count));
}
[Test]
public void should_return_ezrssparser()
{
GivenSuccessful(new TorrentRssIndexerParserSettings
{
UseEZTVFormat = true
});
var parser = Subject.GetParser(_indexerSettings1);
parser.Should().BeOfType<EzrssTorrentRssParser>();
}
[Test]
public void should_return_generic_torrentrssparser()
{
GivenSuccessful(new TorrentRssIndexerParserSettings
{
ParseSeedersInDescription = true,
ParseSizeInDescription = true,
SizeElementName = "Hello"
});
var parser = Subject.GetParser(_indexerSettings1);
parser.Should().BeOfType<TorrentRssParser>();
var rssParser = parser as TorrentRssParser;
rssParser.ParseSeedersInDescription.Should().BeTrue();
rssParser.ParseSizeInDescription.Should().BeTrue();
rssParser.SizeElementName.Should().Be("Hello");
}
[Test]
public void should_throw_on_failure()
{
GivenFailed();
Assert.Throws<UnsupportedFeedException>(() => Subject.GetParser(_indexerSettings1));
}
[Test]
public void should_cache_settings_for_same_baseurl()
{
GivenSuccessful();
var detection1 = Subject.GetParser(_indexerSettings1);
var detection2 = Subject.GetParser(_indexerSettings1);
detection1.ShouldBeEquivalentTo(detection2);
VerifyDetectionCount(1);
}
[Test]
public void should_not_cache_failure()
{
GivenFailed();
Assert.Throws<UnsupportedFeedException>(() => Subject.GetParser(_indexerSettings1));
GivenSuccessful();
Subject.GetParser(_indexerSettings1);
VerifyDetectionCount(2);
}
[Test]
public void should_not_cache_settings_for_different_baseurl()
{
GivenSuccessful();
var detection1 = Subject.GetParser(_indexerSettings1);
var detection2 = Subject.GetParser(_indexerSettings2);
VerifyDetectionCount(2);
}
[Test]
public void should_not_cache_settings_for_different_settings()
{
GivenSuccessful();
var detection1 = Subject.GetParser(_indexerSettings1);
var detection2 = Subject.GetParser(_indexerSettings3);
VerifyDetectionCount(2);
}
}
}
@@ -0,0 +1,207 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Http;
using NzbDrone.Core.Indexers.Exceptions;
using NzbDrone.Core.Indexers.TorrentRss;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.IndexerTests.TorrentRssIndexerTests
{
[TestFixture]
public class TorrentRssSettingsDetectorFixture : CoreTest<TorrentRssSettingsDetector>
{
private const string _indexerUrl = "http://my.indexer.tv/recent";
private TorrentRssIndexerSettings _indexerSettings;
[SetUp]
public void SetUp()
{
_indexerSettings = new TorrentRssIndexerSettings { BaseUrl = _indexerUrl };
}
private void GivenRecentFeedResponse(string rssXmlFile)
{
var recentFeed = ReadAllText(@"Files/Indexers/" + rssXmlFile);
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.IsAny<HttpRequest>()))
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), recentFeed));
}
[Test]
public void should_detect_rss_settings_for_eztv()
{
GivenRecentFeedResponse("Eztv/Eztv.xml");
var settings = Subject.Detect(_indexerSettings);
settings.ShouldBeEquivalentTo(new TorrentRssIndexerParserSettings
{
UseEZTVFormat = true,
UseEnclosureLength = false,
ParseSizeInDescription = false,
ParseSeedersInDescription = false,
SizeElementName = null
});
}
[Test]
public void should_detect_rss_settings_for_speed_cd()
{
GivenRecentFeedResponse("TorrentRss/speed.cd.xml");
var settings = Subject.Detect(_indexerSettings);
settings.ShouldBeEquivalentTo(new TorrentRssIndexerParserSettings
{
UseEZTVFormat = false,
UseEnclosureLength = false,
ParseSizeInDescription = true,
ParseSeedersInDescription = false,
SizeElementName = null
});
}
[Test]
public void should_detect_rss_settings_for_ImmortalSeed()
{
GivenRecentFeedResponse("TorrentRss/ImmortalSeed.xml");
var settings = Subject.Detect(_indexerSettings);
settings.ShouldBeEquivalentTo(new TorrentRssIndexerParserSettings
{
UseEZTVFormat = false,
UseEnclosureLength = false,
ParseSizeInDescription = true,
ParseSeedersInDescription = true,
SizeElementName = null
});
}
[Test]
public void should_detect_rss_settings_for_ShowRSS_info()
{
_indexerSettings.AllowZeroSize = true;
GivenRecentFeedResponse("TorrentRss/ShowRSS.info.xml");
var settings = Subject.Detect(_indexerSettings);
settings.ShouldBeEquivalentTo(new TorrentRssIndexerParserSettings
{
UseEZTVFormat = false,
UseEnclosureLength = false,
ParseSizeInDescription = false,
ParseSeedersInDescription = false,
SizeElementName = null
});
}
[Test]
public void should_detect_rss_settings_for_TransmitTheNet()
{
GivenRecentFeedResponse("TorrentRss/TransmitTheNet.xml");
var settings = Subject.Detect(_indexerSettings);
settings.ShouldBeEquivalentTo(new TorrentRssIndexerParserSettings
{
UseEZTVFormat = false,
UseEnclosureLength = false,
ParseSizeInDescription = true,
ParseSeedersInDescription = false,
SizeElementName = null
});
}
[Test]
[Ignore("Cannot reliably reject unparseable titles")]
public void should_reject_rss_settings_for_AwesomeHD()
{
_indexerSettings.AllowZeroSize = true;
GivenRecentFeedResponse("TorrentRss/AwesomeHD.xml");
var settings = Subject.Detect(_indexerSettings);
settings.Should().BeNull();
}
[TestCase("BitMeTv/BitMeTv.xml")]
[TestCase("Fanzub/fanzub.xml")]
[TestCase("KickassTorrents/KickassTorrents.xml")]
[TestCase("IPTorrents/IPTorrents.xml")]
[TestCase("Newznab/newznab_nzb_su.xml")]
[TestCase("Nyaa/Nyaa.xml")]
[TestCase("Omgwtfnzbs/Omgwtfnzbs.xml")]
[TestCase("Torznab/torznab_hdaccess_net.xml")]
[TestCase("Torznab/torznab_tpb.xml")]
public void should_detect_recent_feed(string rssXmlFile)
{
GivenRecentFeedResponse(rssXmlFile);
var settings = Subject.Detect(_indexerSettings);
settings.Should().NotBeNull();
}
[TestCase("TorrentRss/invalid/Eztv_InvalidDownloadUrl.xml")]
[TestCase("TorrentRss/invalid/ImmortalSeed_InvalidDownloadUrl.xml")]
public void should_reject_recent_feed_with_invalid_downloadurl(string rssXmlFile)
{
GivenRecentFeedResponse(rssXmlFile);
var ex = Assert.Throws<UnsupportedFeedException>(() => Subject.Detect(_indexerSettings));
ex.Message.Should().Contain("download url");
}
[TestCase("TorrentRss/invalid/TorrentDay_NoPubDate.xml")]
public void should_reject_recent_feed_without_pubDate(string rssXmlFile)
{
GivenRecentFeedResponse(rssXmlFile);
var ex = Assert.Throws<UnsupportedFeedException>(() => Subject.Detect(_indexerSettings));
ex.Message.Should().Contain("Empty feed");
ExceptionVerification.ExpectedErrors(1);
}
[TestCase("Torrentleech/Torrentleech.xml")]
[TestCase("Wombles/wombles.xml")]
[TestCase("TorrentRss/invalid/Eztv_InvalidSize.xml")]
[TestCase("TorrentRss/invalid/ImmortalSeed_InvalidSize.xml")]
public void should_detect_feed_without_size(string rssXmlFile)
{
_indexerSettings.AllowZeroSize = true;
GivenRecentFeedResponse(rssXmlFile);
var settings = Subject.Detect(_indexerSettings);
settings.Should().NotBeNull();
settings.UseEnclosureLength.Should().BeFalse();
settings.ParseSizeInDescription.Should().BeFalse();
settings.SizeElementName.Should().BeNull();
}
[TestCase("TorrentRss/invalid/Eztv_InvalidSize.xml")]
[TestCase("TorrentRss/invalid/ImmortalSeed_InvalidSize.xml")]
public void should_reject_feed_without_size(string rssXmlFile)
{
GivenRecentFeedResponse(rssXmlFile);
var ex = Assert.Throws<UnsupportedFeedException>(() => Subject.Detect(_indexerSettings));
ex.Message.Should().Contain("content size");
}
}
}
@@ -27,7 +27,7 @@ namespace NzbDrone.Core.Test.IndexerTests.TorrentleechTests
[Test]
public void should_parse_recent_feed_from_Torrentleech()
{
var recentFeed = ReadAllText(@"Files/RSS/Torrentleech.xml");
var recentFeed = ReadAllText(@"Files/Indexers/Torrentleech/Torrentleech.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
@@ -31,7 +31,7 @@ namespace NzbDrone.Core.Test.IndexerTests.TorznabTests
[Test]
public void should_parse_recent_feed_from_torznab_hdaccess_net()
{
var recentFeed = ReadAllText(@"Files/RSS/torznab_hdaccess_net.xml");
var recentFeed = ReadAllText(@"Files/Indexers/Torznab/torznab_hdaccess_net.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
@@ -61,7 +61,7 @@ namespace NzbDrone.Core.Test.IndexerTests.TorznabTests
[Test]
public void should_parse_recent_feed_from_torznab_tpb()
{
var recentFeed = ReadAllText(@"Files/RSS/torznab_tpb.xml");
var recentFeed = ReadAllText(@"Files/Indexers/Torznab/torznab_tpb.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))