Radarr/NzbDrone.App.Test/CentralDispatchTests.cs

45 lines
1.2 KiB
C#
Raw Normal View History

2013-01-03 01:09:13 +00:00
using Autofac;
using FluentAssertions;
2011-10-11 07:11:05 +00:00
using NUnit.Framework;
2011-11-13 18:16:31 +00:00
using NzbDrone.Test.Common;
2011-10-11 07:11:05 +00:00
namespace NzbDrone.App.Test
{
[TestFixture]
2011-11-13 18:16:31 +00:00
public class CentralDispatchTests : TestBase
2011-10-11 07:11:05 +00:00
{
[Test]
public void Kernel_can_get_kernel()
{
2013-03-01 00:50:50 +00:00
NzbDroneBootstrapper.Container.Should().NotBeNull();
2011-10-11 07:11:05 +00:00
}
[Test]
public void Kernel_should_return_same_kernel()
{
2013-03-01 00:50:50 +00:00
var firstKernel = NzbDroneBootstrapper.Container;
var secondKernel = NzbDroneBootstrapper.Container;
2011-10-11 07:11:05 +00:00
firstKernel.Should().BeSameAs(secondKernel);
}
[Test]
public void Kernel_should_be_able_to_resolve_ApplicationServer()
{
2013-03-01 00:50:50 +00:00
var appServer = NzbDroneBootstrapper.Container.Resolve<ApplicationServer>();
2011-10-11 07:11:05 +00:00
appServer.Should().NotBeNull();
}
2011-10-13 02:24:30 +00:00
[Test]
public void Kernel_should_resolve_same_ApplicationServer_instance()
{
2013-03-01 00:50:50 +00:00
var appServer1 = NzbDroneBootstrapper.Container.Resolve<ApplicationServer>();
var appServer2 = NzbDroneBootstrapper.Container.Resolve<ApplicationServer>();
2011-10-13 02:24:30 +00:00
appServer1.Should().BeSameAs(appServer2);
}
2011-10-11 07:11:05 +00:00
}
}