1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-28 23:07:13 -04:00
Files
Radarr/src/NzbDrone.Common.Test/EnsureTest/PathExtensionFixture.cs
T
Mark McDowall ae63b85753 New: Improve path validation when handling paths from different OSes
(cherry picked from commit 0321368cc392d7a0a488409bf6bd586ba45497af)
(cherry picked from commit 033936dce7e13c8ab2e38407782dc9cdd949460e)
2023-05-08 02:02:22 +03:00

27 lines
770 B
C#

using NUnit.Framework;
using NzbDrone.Common.Disk;
using NzbDrone.Common.EnsureThat;
using NzbDrone.Test.Common;
namespace NzbDrone.Common.Test.EnsureTest
{
[TestFixture]
public class PathExtensionFixture : TestBase
{
[TestCase(@"p:\TV Shows\file with, comma.mkv")]
[TestCase(@"\\serer\share\file with, comma.mkv")]
public void EnsureWindowsPath(string path)
{
WindowsOnly();
Ensure.That(path, () => path).IsValidPath(PathValidationType.CurrentOs);
}
[TestCase(@"/var/user/file with, comma.mkv")]
public void EnsureLinuxPath(string path)
{
PosixOnly();
Ensure.That(path, () => path).IsValidPath(PathValidationType.CurrentOs);
}
}
}