mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Cleaned up ConfigProvider, added tests for paths.
This commit is contained in:
parent
e15e79a6c1
commit
b456c5c4d2
6 changed files with 118 additions and 38 deletions
58
NzbDrone.App.Test/ConfigProviderTest.cs
Normal file
58
NzbDrone.App.Test/ConfigProviderTest.cs
Normal file
|
@ -0,0 +1,58 @@
|
|||
using FluentAssertions;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue