Service (work in progress)

This commit is contained in:
kay.one 2011-10-11 00:11:05 -07:00
commit ba11b34099
10 changed files with 166 additions and 87 deletions

View file

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using FluentAssertions;
using NUnit.Framework;
using Ninject;
using NzbDrone.Providers;
namespace NzbDrone.App.Test
{
[TestFixture]
public class CentralDispatchTests
{
[Test]
public void Kernel_can_get_kernel()
{
CentralDispatch.Kernel.Should().NotBeNull();
}
[Test]
public void Kernel_should_return_same_kernel()
{
var firstKernel = CentralDispatch.Kernel;
var secondKernel = CentralDispatch.Kernel;
firstKernel.Should().BeSameAs(secondKernel);
}
[Test]
public void Kernel_should_be_able_to_resolve_ApplicationServer()
{
var appServer = CentralDispatch.Kernel.Get<ApplicationServer>();
appServer.Should().NotBeNull();
}
}
}

View file

@ -49,6 +49,7 @@
<Reference Include="Moq">
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
</Reference>
<Reference Include="Ninject, Version=2.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL" />
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
</Reference>
@ -72,6 +73,7 @@
<Compile Include="AutoMoq\AutoMoqerTest.cs" />
<Compile Include="AutoMoq\Unity\AutoMockingBuilderStrategy.cs" />
<Compile Include="AutoMoq\Unity\AutoMockingContainerExtension.cs" />
<Compile Include="CentralDispatchTests.cs" />
<Compile Include="ProgramTest.cs" />
<Compile Include="MonitoringProviderTest.cs" />
<Compile Include="ConfigProviderTest.cs" />

View file

@ -29,7 +29,7 @@ namespace NzbDrone.App.Test
[TestCase("-u", ApplicationMode.UninstallService)]
public void GetApplicationMode_single_arg(string arg, ApplicationMode mode)
{
Console.GetApplicationMode(new[] { arg }).Should().Be(mode);
NzbDroneConsole.GetApplicationMode(new[] { arg }).Should().Be(mode);
}
[TestCase("", "", ApplicationMode.Console)]
@ -37,7 +37,7 @@ namespace NzbDrone.App.Test
[TestCase("i", "n", ApplicationMode.Help)]
public void GetApplicationMode_two_args(string a, string b, ApplicationMode mode)
{
Console.GetApplicationMode(new[] { a, b }).Should().Be(mode);
NzbDroneConsole.GetApplicationMode(new[] { a, b }).Should().Be(mode);
}
}
}