mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
fixing linux tests
This commit is contained in:
parent
9330f0aefc
commit
05370518c5
6 changed files with 53 additions and 19 deletions
|
@ -97,6 +97,7 @@
|
|||
<Compile Include="MockerExtensions.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ReflectionExtensions.cs" />
|
||||
<Compile Include="StringExtensions.cs" />
|
||||
<Compile Include="TestBase.cs" />
|
||||
<Compile Include="TestException.cs" />
|
||||
</ItemGroup>
|
||||
|
|
22
NzbDrone.Test.Common/StringExtensions.cs
Normal file
22
NzbDrone.Test.Common/StringExtensions.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
using System.IO;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
|
||||
namespace NzbDrone.Test.Common
|
||||
{
|
||||
public static class StringExtensions
|
||||
{
|
||||
public static string AsOsAgnostic(this string path)
|
||||
{
|
||||
if (OsInfo.IsLinux)
|
||||
{
|
||||
if (path.Length > 2 && path[1] == ':')
|
||||
{
|
||||
path = path.Replace(':', Path.DirectorySeparatorChar);
|
||||
}
|
||||
path = path.Replace("\\", Path.DirectorySeparatorChar.ToString());
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue