mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-03 09:09:42 +02:00
More CentralDispatch Tests (bug caught!)
This commit is contained in:
@@ -8,7 +8,9 @@ using NUnit.Framework;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Core.Jobs;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Providers.ExternalNotification;
|
||||
using NzbDrone.Core.Providers.Indexer;
|
||||
using NzbDrone.Core.Providers.Metadata;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test
|
||||
@@ -18,6 +20,8 @@ namespace NzbDrone.Core.Test
|
||||
{
|
||||
readonly IList<Type> indexers = typeof(CentralDispatch).Assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(IndexerBase))).ToList();
|
||||
readonly IList<Type> jobs = typeof(CentralDispatch).Assembly.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IJob))).ToList();
|
||||
readonly IList<Type> extNotifications = typeof(CentralDispatch).Assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(ExternalNotificationBase))).ToList();
|
||||
readonly IList<Type> metadata = typeof(CentralDispatch).Assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(MetadataBase))).ToList();
|
||||
|
||||
private IContainer kernel;
|
||||
|
||||
@@ -50,7 +54,6 @@ namespace NzbDrone.Core.Test
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void All_jobs_should_be_registered()
|
||||
{
|
||||
@@ -63,7 +66,6 @@ namespace NzbDrone.Core.Test
|
||||
registeredJobs.Should().HaveSameCount(jobs);
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void All_indexers_should_be_registered()
|
||||
{
|
||||
@@ -76,6 +78,29 @@ namespace NzbDrone.Core.Test
|
||||
registeredIndexers.Should().HaveSameCount(indexers);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void All_externalNotifiers_should_be_registered()
|
||||
{
|
||||
//Assert
|
||||
|
||||
var externalNotificationBases = kernel.Resolve<IEnumerable<ExternalNotificationBase>>();
|
||||
|
||||
extNotifications.Should().NotBeEmpty();
|
||||
|
||||
externalNotificationBases.Should().HaveSameCount(extNotifications);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void All_metadata_clients_should_be_registered()
|
||||
{
|
||||
//Assert
|
||||
|
||||
var metadataBases = kernel.Resolve<IEnumerable<MetadataBase>>();
|
||||
|
||||
metadata.Should().NotBeEmpty();
|
||||
|
||||
metadataBases.Should().HaveSameCount(metadata);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void jobs_are_initialized()
|
||||
@@ -89,6 +114,18 @@ namespace NzbDrone.Core.Test
|
||||
kernel.Resolve<IndexerProvider>().All().Should().HaveSameCount(indexers);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void externalNotifiers_are_initialized()
|
||||
{
|
||||
kernel.Resolve<ExternalNotificationProvider>().All().Should().HaveSameCount(extNotifications);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void metadata_clients_are_initialized()
|
||||
{
|
||||
kernel.Resolve<MetadataProvider>().All().Should().HaveSameCount(metadata);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void quality_profile_initialized()
|
||||
{
|
||||
|
Reference in New Issue
Block a user