2013-05-09 09:38:20 +03:00
|
|
|
using System.Linq;
|
|
|
|
using FluentAssertions;
|
|
|
|
using NUnit.Framework;
|
2013-08-13 08:08:37 +03:00
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
2013-05-09 09:38:20 +03:00
|
|
|
using NzbDrone.Core.Lifecycle;
|
2013-09-11 09:33:47 +03:00
|
|
|
using NzbDrone.Core.Messaging;
|
2013-09-14 09:36:07 +03:00
|
|
|
using NzbDrone.Core.Messaging.Events;
|
2013-08-07 08:32:22 +03:00
|
|
|
using NzbDrone.Host;
|
2013-05-09 09:38:20 +03:00
|
|
|
using NzbDrone.Test.Common;
|
|
|
|
|
|
|
|
namespace NzbDrone.Common.Test
|
|
|
|
{
|
|
|
|
[TestFixture]
|
|
|
|
public class ServiceFactoryFixture : TestBase<ServiceFactory>
|
|
|
|
{
|
|
|
|
[SetUp]
|
|
|
|
public void setup()
|
|
|
|
{
|
2013-08-13 08:08:37 +03:00
|
|
|
Mocker.SetConstant(MainAppContainerBuilder.BuildContainer(new StartupArguments()));
|
2013-05-09 09:38:20 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void event_handlers_should_be_unique()
|
|
|
|
{
|
|
|
|
var handlers = Subject.BuildAll<IHandle<ApplicationShutdownRequested>>()
|
|
|
|
.Select(c => c.GetType().FullName);
|
|
|
|
|
|
|
|
handlers.Should().OnlyHaveUniqueItems();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|