More bugfixes, tests.

pull/2/head
kay.one 13 years ago
parent b456c5c4d2
commit be651660a4

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

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

@ -43,6 +43,14 @@ namespace NzbDrone.App.Test
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()
{

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

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

@ -1,4 +1,5 @@
using System;
using System.Reflection;
using NLog;
using Ninject;
using NzbDrone.Providers;
@ -25,7 +26,7 @@ namespace NzbDrone
Kernel.Bind<ServiceProvider>().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<Application>().Start();
}

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

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

Loading…
Cancel
Save