fixed broken tests.

pull/4/head
kay.one 11 years ago committed by kayone
parent 3e9a6ed0ef
commit 1e88d2b7c3

@ -11,5 +11,6 @@ namespace NzbDrone.Api.Indexers
public String Name { get; set; }
public List<Field> Fields { get; set; }
public String Implementation { get; set; }
public String ConfigContract { get; set; }
}
}

@ -9,7 +9,7 @@ using NzbDrone.Core.ThingiProvider;
namespace NzbDrone.Core.Test.ThingiProvider
{
public class ProviderRepositoryFixture : DbTest<ProviderRepository<IndexerDefinition>, IndexerDefinition>
public class ProviderRepositoryFixture : DbTest<IndexerRepository, IndexerDefinition>
{
[Test]
public void should_read_write_download_provider()

@ -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<IndexerDefinition>
public interface IIndexerRepository : IProviderRepository<IndexerDefinition>
{
IndexerDefinition Get(string name);
IndexerDefinition Find(string name);
}
public class IndexerRepository : BasicRepository<IndexerDefinition>, IIndexerRepository
public class IndexerRepository : ProviderRepository<IndexerDefinition>, 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));
}
}
}

@ -12,10 +12,10 @@ namespace NzbDrone.Core.Indexers
public class IndexerService : ProviderFactory<IIndexer, IndexerDefinition>
{
private readonly IProviderRepository<IndexerDefinition> _providerRepository;
private readonly IIndexerRepository _providerRepository;
private readonly IEnumerable<IIndexer> _providers;
public IndexerService(IProviderRepository<IndexerDefinition> providerRepository, IEnumerable<IIndexer> providers, Logger logger)
public IndexerService(IIndexerRepository providerRepository, IEnumerable<IIndexer> providers, Logger logger)
: base(providerRepository, providers, logger)
{
_providerRepository = providerRepository;

Loading…
Cancel
Save