Alot of refactoring.

This commit is contained in:
kay.one 2011-11-12 23:27:16 -08:00
commit 72d0fc50ed
89 changed files with 503 additions and 767 deletions

View file

@ -1,59 +0,0 @@
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Common;
using NzbDrone.Providers;
namespace NzbDrone.App.Test
{
[TestFixture]
public class ConfigProviderTest
{
private ConfigProvider GetConfigProvider()
{
var envMoq = new Mock<EnviromentProvider>();
envMoq.SetupGet(c => c.ApplicationPath).Returns(@"C:\NzbDrone\");
return new ConfigProvider(envMoq.Object);
}
[Test]
public void IISExpress_path_test()
{
GetConfigProvider().IISDirectory.Should().BeEquivalentTo(@"C:\NzbDrone\IISExpress");
}
[Test]
public void AppDataDirectory_path_test()
{
GetConfigProvider().AppDataDirectory.Should().BeEquivalentTo(@"C:\NzbDrone\NzbDrone.Web\App_Data");
}
[Test]
public void Config_path_test()
{
GetConfigProvider().ConfigFile.Should().BeEquivalentTo(@"C:\NzbDrone\NzbDrone.Web\App_Data\Config.xml");
}
[Test]
public void IISConfig_path_test()
{
GetConfigProvider().IISConfigPath.Should().BeEquivalentTo(@"C:\NzbDrone\IISExpress\AppServer\applicationhost.config");
}
[Test]
public void IISExe_path_test()
{
GetConfigProvider().IISExePath.Should().BeEquivalentTo(@"C:\NzbDrone\IISExpress\IISExpress.exe");
}
[Test]
public void NlogConfig_path_test()
{
GetConfigProvider().NlogConfigPath.Should().BeEquivalentTo(@"C:\NzbDrone\NzbDrone.Web\log.config");
}
}
}

View file

@ -1,36 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using AutoMoq;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Common;
using NzbDrone.Providers;
namespace NzbDrone.App.Test
{
[TestFixture]
public class IISProviderTest
{
[Test]
public void start_should_set_IISProccessId_property()
{
var mocker = new AutoMoqer();
var configMock = mocker.GetMock<ConfigProvider>();
configMock.SetupGet(c => c.IISExePath).Returns("NzbDrone.Test.Dummy.exe");
mocker.Resolve<ProcessProvider>();
var iisProvider = mocker.Resolve<IISProvider>();
iisProvider.StartServer();
iisProvider.IISProcessId.Should().NotBe(0);
}
}
}

View file

@ -68,8 +68,6 @@
<Compile Include="Fixtures.cs" />
<Compile Include="RouterTest.cs" />
<Compile Include="MonitoringProviderTest.cs" />
<Compile Include="ConfigProviderTest.cs" />
<Compile Include="IISProviderTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>