mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
GetActualCasing can partially fix the path for non-existing paths.
This commit is contained in:
parent
5dc3a3223d
commit
ef32431682
2 changed files with 20 additions and 15 deletions
|
@ -102,10 +102,18 @@ namespace NzbDrone.Common.Test
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void get_actual_casing_for_none_existing_file_should_throw()
|
||||
public void get_actual_casing_for_none_existing_file_return_partially_fixed_result()
|
||||
{
|
||||
WindowsOnly();
|
||||
Assert.Throws<DirectoryNotFoundException>(() => "C:\\InValidFolder\\invalidfile.exe".GetActualCasing());
|
||||
"C:\\WINDOWS\\invalidfile.exe".GetActualCasing().Should().Be("C:\\Windows\\invalidfile.exe");
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void get_actual_casing_for_none_existing_folder_return_partially_fixed_result()
|
||||
{
|
||||
WindowsOnly();
|
||||
"C:\\WINDOWS\\SYSTEM32\\FAKEFOLDER\\invalidfile.exe".GetActualCasing().Should().Be("C:\\Windows\\System32\\FAKEFOLDER\\invalidfile.exe");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -117,14 +125,7 @@ namespace NzbDrone.Common.Test
|
|||
path.ToLower().GetActualCasing().Should().Be(path);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void get_actual_casing_should_return_origibal_value_in_linux()
|
||||
{
|
||||
LinuxOnly();
|
||||
var path = Process.GetCurrentProcess().MainModule.FileName;
|
||||
path.GetActualCasing().Should().Be(path);
|
||||
path.GetActualCasing().Should().Be(path);
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void get_actual_casing_should_return_actual_casing_for_local_dir_in_windows()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue