|
|
@ -2,6 +2,7 @@
|
|
|
|
using FluentAssertions;
|
|
|
|
using FluentAssertions;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
|
|
|
|
using NzbDrone.Core.Datastore;
|
|
|
|
using NzbDrone.Core.Lifecycle;
|
|
|
|
using NzbDrone.Core.Lifecycle;
|
|
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
using NzbDrone.Host;
|
|
|
|
using NzbDrone.Host;
|
|
|
@ -16,11 +17,12 @@ namespace NzbDrone.Common.Test
|
|
|
|
public void event_handlers_should_be_unique()
|
|
|
|
public void event_handlers_should_be_unique()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var container = MainAppContainerBuilder.BuildContainer(new StartupContext());
|
|
|
|
var container = MainAppContainerBuilder.BuildContainer(new StartupContext());
|
|
|
|
|
|
|
|
container.Register<IMainDatabase>(new MainDatabase(null));
|
|
|
|
container.Resolve<IAppFolderFactory>().Register();
|
|
|
|
container.Resolve<IAppFolderFactory>().Register();
|
|
|
|
|
|
|
|
|
|
|
|
Mocker.SetConstant(container);
|
|
|
|
Mocker.SetConstant(container);
|
|
|
|
|
|
|
|
|
|
|
|
var handlers = Subject.BuildAll<IHandle<ApplicationShutdownRequested>>()
|
|
|
|
var handlers = Subject.BuildAll<IHandle<ApplicationStartedEvent>>()
|
|
|
|
.Select(c => c.GetType().FullName);
|
|
|
|
.Select(c => c.GetType().FullName);
|
|
|
|
|
|
|
|
|
|
|
|
handlers.Should().OnlyHaveUniqueItems();
|
|
|
|
handlers.Should().OnlyHaveUniqueItems();
|
|
|
|