mirror of
https://github.com/Radarr/Radarr
synced 2024-12-31 20:35:37 +00:00
fixed broken tests.
This commit is contained in:
parent
3e9a6ed0ef
commit
1e88d2b7c3
4 changed files with 9 additions and 21 deletions
|
@ -11,5 +11,6 @@ public class IndexerResource : RestResource
|
|||
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 @@
|
|||
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 @@ public interface IIndexerService : IProviderFactory<IIndexer, IndexerDefinition>
|
|||
|
||||
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…
Reference in a new issue