More bugfixes, tests.

This commit is contained in:
kay.one 2011-10-07 22:06:16 -07:00
parent b456c5c4d2
commit be651660a4
9 changed files with 17 additions and 8 deletions

View File

@ -9,7 +9,7 @@ using NzbDrone.Providers;
namespace NzbDrone.App.Test namespace NzbDrone.App.Test
{ {
[TestFixture] [TestFixture]
public class EnviromentControllerTest public class EnviromentProviderTest
{ {
[Test] [Test]

View File

@ -72,11 +72,11 @@
<Compile Include="AutoMoq\AutoMoqerTest.cs" /> <Compile Include="AutoMoq\AutoMoqerTest.cs" />
<Compile Include="AutoMoq\Unity\AutoMockingBuilderStrategy.cs" /> <Compile Include="AutoMoq\Unity\AutoMockingBuilderStrategy.cs" />
<Compile Include="AutoMoq\Unity\AutoMockingContainerExtension.cs" /> <Compile Include="AutoMoq\Unity\AutoMockingContainerExtension.cs" />
<Compile Include="ApplicationTest.cs" /> <Compile Include="MonitoringProviderTest.cs" />
<Compile Include="ConfigProviderTest.cs" /> <Compile Include="ConfigProviderTest.cs" />
<Compile Include="IISProviderTest.cs" /> <Compile Include="IISProviderTest.cs" />
<Compile Include="ProcessProviderTests.cs" /> <Compile Include="ProcessProviderTests.cs" />
<Compile Include="EnviromentControllerTest.cs" /> <Compile Include="EnviromentProviderTest.cs" />
<Compile Include="ServiceControllerTests.cs" /> <Compile Include="ServiceControllerTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>

View File

@ -43,6 +43,14 @@ namespace NzbDrone.App.Test
dummyProcess.HasExited.Should().BeTrue(); dummyProcess.HasExited.Should().BeTrue();
} }
[TestCase(0)]
[TestCase(-1)]
[TestCase(9999)]
public void GetProcessById_should_return_null_for_invalid_process(int processId)
{
_processProvider.GetProcessById(processId).Should().BeNull();
}
public Process StartDummyProcess() public Process StartDummyProcess()
{ {

View File

@ -50,5 +50,5 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.5.0.*")] [assembly: AssemblyVersion("0.6.0.*")]
[assembly: InternalsVisibleTo("NzbDrone.Core.Test")] [assembly: InternalsVisibleTo("NzbDrone.Core.Test")]

View File

@ -34,4 +34,4 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("0.5.0.*")] [assembly: AssemblyVersion("0.6.0.*")]

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Reflection;
using NLog; using NLog;
using Ninject; using Ninject;
using NzbDrone.Providers; using NzbDrone.Providers;
@ -25,7 +26,7 @@ namespace NzbDrone
Kernel.Bind<ServiceProvider>().ToSelf().InSingletonScope(); Kernel.Bind<ServiceProvider>().ToSelf().InSingletonScope();
Kernel.Bind<WebClientProvider>().ToSelf().InSingletonScope(); Kernel.Bind<WebClientProvider>().ToSelf().InSingletonScope();
Console.WriteLine("Starting Console."); Console.WriteLine("Starting NzbDrone Console. Version " + Assembly.GetExecutingAssembly().GetName().Version);
Kernel.Get<MonitoringProvider>().Start(); Kernel.Get<MonitoringProvider>().Start();
Kernel.Get<Application>().Start(); Kernel.Get<Application>().Start();
} }

View File

@ -36,4 +36,4 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.5.0.*")] [assembly: AssemblyVersion("0.6.0.*")]

View File

@ -73,7 +73,7 @@ namespace NzbDrone.Providers
private static ProcessInfo ConvertToProcessInfo(Process process) private static ProcessInfo ConvertToProcessInfo(Process process)
{ {
if (process == null) return null; if (process == null || process.Id <= 0) return null;
return new ProcessInfo return new ProcessInfo
{ {