From 1e88d2b7c3c7e9916d4be45309e0472f974eab62 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sun, 22 Sep 2013 13:06:11 -0700 Subject: [PATCH] fixed broken tests. --- NzbDrone.Api/Indexers/IndexerResource.cs | 1 + .../ThingiProvider/ProviderBaseFixture.cs | 2 +- NzbDrone.Core/Indexers/IndexerRepository.cs | 23 ++++--------------- NzbDrone.Core/Indexers/IndexerService.cs | 4 ++-- 4 files changed, 9 insertions(+), 21 deletions(-) diff --git a/NzbDrone.Api/Indexers/IndexerResource.cs b/NzbDrone.Api/Indexers/IndexerResource.cs index 34a31551a..a613526fe 100644 --- a/NzbDrone.Api/Indexers/IndexerResource.cs +++ b/NzbDrone.Api/Indexers/IndexerResource.cs @@ -11,5 +11,6 @@ public class IndexerResource : RestResource public String Name { get; set; } public List Fields { get; set; } public String Implementation { get; set; } + public String ConfigContract { get; set; } } } \ No newline at end of file diff --git a/NzbDrone.Core.Test/ThingiProvider/ProviderBaseFixture.cs b/NzbDrone.Core.Test/ThingiProvider/ProviderBaseFixture.cs index 8aa47c176..641e62dca 100644 --- a/NzbDrone.Core.Test/ThingiProvider/ProviderBaseFixture.cs +++ b/NzbDrone.Core.Test/ThingiProvider/ProviderBaseFixture.cs @@ -9,7 +9,7 @@ namespace NzbDrone.Core.Test.ThingiProvider { - public class ProviderRepositoryFixture : DbTest, IndexerDefinition> + public class ProviderRepositoryFixture : DbTest { [Test] public void should_read_write_download_provider() diff --git a/NzbDrone.Core/Indexers/IndexerRepository.cs b/NzbDrone.Core/Indexers/IndexerRepository.cs index b4c6446a1..269bb5507 100644 --- a/NzbDrone.Core/Indexers/IndexerRepository.cs +++ b/NzbDrone.Core/Indexers/IndexerRepository.cs @@ -1,33 +1,20 @@ -using System; -using System.Linq; -using NzbDrone.Core.Datastore; +using NzbDrone.Core.Datastore; using NzbDrone.Core.Messaging.Events; +using NzbDrone.Core.ThingiProvider; namespace NzbDrone.Core.Indexers { - public interface IIndexerRepository : IBasicRepository + public interface IIndexerRepository : IProviderRepository { - IndexerDefinition Get(string name); - IndexerDefinition Find(string name); + } - public class IndexerRepository : BasicRepository, IIndexerRepository + public class IndexerRepository : ProviderRepository, IIndexerRepository { public IndexerRepository(IDatabase database, IEventAggregator eventAggregator) : base(database, eventAggregator) { } - - public IndexerDefinition Get(string name) - { - return Query.Single(i => i.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)); - } - - public IndexerDefinition Find(string name) - { - return Query.SingleOrDefault(i => i.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)); - } - } } diff --git a/NzbDrone.Core/Indexers/IndexerService.cs b/NzbDrone.Core/Indexers/IndexerService.cs index e56531438..dd1b9aca9 100644 --- a/NzbDrone.Core/Indexers/IndexerService.cs +++ b/NzbDrone.Core/Indexers/IndexerService.cs @@ -12,10 +12,10 @@ public interface IIndexerService : IProviderFactory public class IndexerService : ProviderFactory { - private readonly IProviderRepository _providerRepository; + private readonly IIndexerRepository _providerRepository; private readonly IEnumerable _providers; - public IndexerService(IProviderRepository providerRepository, IEnumerable providers, Logger logger) + public IndexerService(IIndexerRepository providerRepository, IEnumerable providers, Logger logger) : base(providerRepository, providers, logger) { _providerRepository = providerRepository;