1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-26 01:37:07 +00:00

fixed Newznab category numbers.

This commit is contained in:
kay.one 2013-06-03 20:33:03 -07:00
parent a7fc3f9776
commit 13cff22cf8
5 changed files with 62 additions and 34 deletions

View file

@ -0,0 +1,59 @@
using FluentAssertions;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers.Newznab;
using NzbDrone.Core.Indexers.NzbClub;
using NzbDrone.Core.Test.Framework;
using NUnit.Framework;
namespace NzbDrone.Core.Test.IndexerTests.IntegrationTests
{
public class IndexerIntegrationTests : CoreTest<FetchFeedService>
{
[Test]
public void nzbclub_rss()
{
UseRealHttp();
var indexer = new NzbClub();
var result = Subject.FetchRss(indexer);
result.Should().NotBeEmpty();
result.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.Title));
result.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.NzbUrl));
//TODO: uncomment these after moving to restsharp for rss
//result.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.NzbInfoUrl));
//result.Should().OnlyContain(c => c.Size > 0);
}
[Test]
[Explicit("needs newznab api key")]
public void nzbsorg_rss()
{
UseRealHttp();
var indexer = new Newznab();
indexer.Settings = new NewznabSettings
{
ApiKey = "",
Url = "http://nzbs.org"
};
indexer.InstanceDefinition = new IndexerDefinition();
var result = Subject.FetchRss(indexer);
result.Should().NotBeEmpty();
result.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.Title));
result.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.NzbUrl));
//TODO: uncomment these after moving to restsharp for rss
//result.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.NzbInfoUrl));
//result.Should().OnlyContain(c => c.Size > 0);
}
}
}

View file

@ -1,31 +0,0 @@
using FluentAssertions;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers.NzbClub;
using NzbDrone.Core.Test.Framework;
using NUnit.Framework;
namespace NzbDrone.Core.Test.IndexerTests.IntegrationTests
{
public class NzbClubIntegrationTests : CoreTest<FetchFeedService>
{
[Test]
public void should_be_able_to_fetch_rss()
{
UseRealHttp();
var indexer = new NzbClub();
var result = Subject.FetchRss(indexer);
result.Should().NotBeEmpty();
result.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.Title));
result.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.NzbUrl));
//TODO: uncomment these after moving to restsharp for rss
//result.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.NzbInfoUrl));
//result.Should().OnlyContain(c => c.Size > 0);
}
}
}

View file

@ -138,7 +138,7 @@
<Compile Include="IndexerTests\BasicRssParserFixture.cs" />
<Compile Include="IndexerTests\IndexerServiceFixture.cs" />
<Compile Include="IndexerTests\IntegrationTests\NzbxIntegrationTests.cs" />
<Compile Include="IndexerTests\IntegrationTests\NzbClubIntegrationTests.cs" />
<Compile Include="IndexerTests\IntegrationTests\IndexerIntegrationTests.cs" />
<Compile Include="IndexerTests\ParserTests\NzbxParserFixture.cs" />
<Compile Include="JobTests\JobRepositoryFixture.cs" />
<Compile Include="DecisionEngineTests\LanguageSpecificationFixture.cs" />

View file

@ -5,7 +5,7 @@ namespace NzbDrone.Core.Indexers
{
public abstract class IndexerWithSetting<TSetting> : IndexerBase where TSetting : class, IIndexerSetting, new()
{
public TSetting Settings { get; private set; }
public TSetting Settings { get; set; }
public TSetting ImportSettingsFromJson(string json)
{

View file

@ -54,7 +54,7 @@ namespace NzbDrone.Core.Indexers.Newznab
{
get
{
var url = String.Format("{0}/api?t=tvsearch&cat=5030,5040,5070,5090s", Settings.Url);
var url = String.Format("{0}/api?t=tvsearch&cat=5000", Settings.Url);
if (!String.IsNullOrWhiteSpace(Settings.ApiKey))
{