1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02:00
Sonarr/NzbDrone.App.Test/CentralDispatchTests.cs
2013-01-02 17:09:13 -08:00

45 lines
1.2 KiB
C#

using Autofac;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.App.Test
{
[TestFixture]
public class CentralDispatchTests : TestBase
{
[Test]
public void Kernel_can_get_kernel()
{
CentralDispatch.Container.Should().NotBeNull();
}
[Test]
public void Kernel_should_return_same_kernel()
{
var firstKernel = CentralDispatch.Container;
var secondKernel = CentralDispatch.Container;
firstKernel.Should().BeSameAs(secondKernel);
}
[Test]
public void Kernel_should_be_able_to_resolve_ApplicationServer()
{
var appServer = CentralDispatch.Container.Resolve<ApplicationServer>();
appServer.Should().NotBeNull();
}
[Test]
public void Kernel_should_resolve_same_ApplicationServer_instance()
{
var appServer1 = CentralDispatch.Container.Resolve<ApplicationServer>();
var appServer2 = CentralDispatch.Container.Resolve<ApplicationServer>();
appServer1.Should().BeSameAs(appServer2);
}
}
}