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