Lidarr/src/NzbDrone.Common.Test/ServiceFactoryFixture.cs

29 lines
853 B
C#
Raw Normal View History

2014-02-10 19:40:13 +00:00
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Core.Lifecycle;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Host;
using NzbDrone.Test.Common;
2014-10-18 05:47:00 +00:00
namespace NzbDrone.Common.Test
2014-02-10 19:40:13 +00:00
{
[TestFixture]
public class ServiceFactoryFixture : TestBase<ServiceFactory>
{
[Test]
public void event_handlers_should_be_unique()
{
2014-10-18 05:47:00 +00:00
var container = MainAppContainerBuilder.BuildContainer(new StartupContext());
container.Resolve<IAppFolderFactory>().Register();
Mocker.SetConstant(container);
2014-02-10 19:40:13 +00:00
var handlers = Subject.BuildAll<IHandle<ApplicationShutdownRequested>>()
.Select(c => c.GetType().FullName);
handlers.Should().OnlyHaveUniqueItems();
}
}
}