|
|
@ -102,30 +102,31 @@ namespace NzbDrone.Common.Test
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[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();
|
|
|
|
WindowsOnly();
|
|
|
|
Assert.Throws<DirectoryNotFoundException>(() => "C:\\InValidFolder\\invalidfile.exe".GetActualCasing());
|
|
|
|
"C:\\WINDOWS\\invalidfile.exe".GetActualCasing().Should().Be("C:\\Windows\\invalidfile.exe");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void get_actual_casing_should_return_actual_casing_for_local_file_in_windows()
|
|
|
|
public void get_actual_casing_for_none_existing_folder_return_partially_fixed_result()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
WindowsOnly();
|
|
|
|
WindowsOnly();
|
|
|
|
var path = Process.GetCurrentProcess().MainModule.FileName;
|
|
|
|
"C:\\WINDOWS\\SYSTEM32\\FAKEFOLDER\\invalidfile.exe".GetActualCasing().Should().Be("C:\\Windows\\System32\\FAKEFOLDER\\invalidfile.exe");
|
|
|
|
path.ToUpper().GetActualCasing().Should().Be(path);
|
|
|
|
|
|
|
|
path.ToLower().GetActualCasing().Should().Be(path);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void get_actual_casing_should_return_origibal_value_in_linux()
|
|
|
|
public void get_actual_casing_should_return_actual_casing_for_local_file_in_windows()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LinuxOnly();
|
|
|
|
WindowsOnly();
|
|
|
|
var path = Process.GetCurrentProcess().MainModule.FileName;
|
|
|
|
var path = Process.GetCurrentProcess().MainModule.FileName;
|
|
|
|
path.GetActualCasing().Should().Be(path);
|
|
|
|
path.ToUpper().GetActualCasing().Should().Be(path);
|
|
|
|
path.GetActualCasing().Should().Be(path);
|
|
|
|
path.ToLower().GetActualCasing().Should().Be(path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void get_actual_casing_should_return_actual_casing_for_local_dir_in_windows()
|
|
|
|
public void get_actual_casing_should_return_actual_casing_for_local_dir_in_windows()
|
|
|
|
{
|
|
|
|
{
|
|
|
|