|
|
@ -3,6 +3,7 @@ using System.IO;
|
|
|
|
using FluentAssertions;
|
|
|
|
using FluentAssertions;
|
|
|
|
using Moq;
|
|
|
|
using Moq;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
using NzbDrone.Common.Disk;
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
using NzbDrone.Common.Extensions;
|
|
|
|
using NzbDrone.Common.Extensions;
|
|
|
|
using NzbDrone.Test.Common;
|
|
|
|
using NzbDrone.Test.Common;
|
|
|
@ -34,7 +35,7 @@ namespace NzbDrone.Common.Test
|
|
|
|
[TestCase(@"\\Testserver\\Test\", @"\\Testserver\Test")]
|
|
|
|
[TestCase(@"\\Testserver\\Test\", @"\\Testserver\Test")]
|
|
|
|
[TestCase(@"\\Testserver\Test\file.ext", @"\\Testserver\Test\file.ext")]
|
|
|
|
[TestCase(@"\\Testserver\Test\file.ext", @"\\Testserver\Test\file.ext")]
|
|
|
|
[TestCase(@"\\Testserver\Test\file.ext\\", @"\\Testserver\Test\file.ext")]
|
|
|
|
[TestCase(@"\\Testserver\Test\file.ext\\", @"\\Testserver\Test\file.ext")]
|
|
|
|
[TestCase(@"\\Testserver\Test\file.ext \\", @"\\Testserver\Test\file.ext")]
|
|
|
|
[TestCase(@"\\Testserver\Test\file.ext ", @"\\Testserver\Test\file.ext")]
|
|
|
|
[TestCase(@"//CAPITAL//lower// ", @"\\CAPITAL\lower")]
|
|
|
|
[TestCase(@"//CAPITAL//lower// ", @"\\CAPITAL\lower")]
|
|
|
|
public void Clean_Path_Windows(string dirty, string clean)
|
|
|
|
public void Clean_Path_Windows(string dirty, string clean)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -334,5 +335,30 @@ namespace NzbDrone.Common.Test
|
|
|
|
result[2].Should().Be(@"TV");
|
|
|
|
result[2].Should().Be(@"TV");
|
|
|
|
result[3].Should().Be(@"Series Title");
|
|
|
|
result[3].Should().Be(@"Series Title");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TestCase(@"C:\Test\")]
|
|
|
|
|
|
|
|
[TestCase(@"C:\Test")]
|
|
|
|
|
|
|
|
[TestCase(@"C:\Test\TV\")]
|
|
|
|
|
|
|
|
[TestCase(@"C:\Test\TV")]
|
|
|
|
|
|
|
|
public void IsPathValid_should_be_true(string path)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
path.AsOsAgnostic().IsPathValid(PathValidationType.CurrentOs).Should().BeTrue();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TestCase(@"C:\Test \")]
|
|
|
|
|
|
|
|
[TestCase(@"C:\Test ")]
|
|
|
|
|
|
|
|
[TestCase(@"C:\ Test\")]
|
|
|
|
|
|
|
|
[TestCase(@"C:\ Test")]
|
|
|
|
|
|
|
|
[TestCase(@"C:\Test \TV")]
|
|
|
|
|
|
|
|
[TestCase(@"C:\ Test\TV")]
|
|
|
|
|
|
|
|
[TestCase(@"C:\Test \TV\")]
|
|
|
|
|
|
|
|
[TestCase(@"C:\ Test\TV\")]
|
|
|
|
|
|
|
|
[TestCase(@" C:\Test\TV\")]
|
|
|
|
|
|
|
|
[TestCase(@" C:\Test\TV")]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void IsPathValid_should_be_false(string path)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
path.AsOsAgnostic().IsPathValid(PathValidationType.CurrentOs).Should().BeFalse();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|