mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-17 10:45:49 +02:00
more linux fixes
This commit is contained in:
parent
aee31d1bc2
commit
324195eb23
@ -81,6 +81,7 @@ public void get_actual_casing_for_none_existing_file_should_throw()
|
||||
[Test]
|
||||
public void get_actual_casing_should_return_actual_casing_for_local_file_in_windows()
|
||||
{
|
||||
WindowsOnly();
|
||||
var path = Process.GetCurrentProcess().MainModule.FileName;
|
||||
path.ToUpper().GetActualCasing().Should().Be(path);
|
||||
path.ToLower().GetActualCasing().Should().Be(path);
|
||||
@ -89,6 +90,7 @@ public void get_actual_casing_should_return_actual_casing_for_local_file_in_wind
|
||||
[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);
|
||||
@ -107,7 +109,7 @@ public void get_actual_casing_should_return_actual_casing_for_local_dir_in_windo
|
||||
[Test]
|
||||
public void get_actual_casing_should_return_original_value_in_linux()
|
||||
{
|
||||
WindowsOnly();
|
||||
LinuxOnly();
|
||||
var path = Directory.GetCurrentDirectory();
|
||||
path.GetActualCasing().Should().Be(path);
|
||||
path.GetActualCasing().Should().Be(path);
|
||||
|
@ -6,6 +6,7 @@
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Core.Organizer;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Test.Common;
|
||||
|
||||
namespace NzbDrone.Core.Test.MediaFileTests
|
||||
{
|
||||
@ -26,9 +27,9 @@ public void filter_should_return_all_files_if_no_existing_files()
|
||||
{
|
||||
var files = new List<string>()
|
||||
{
|
||||
"c:\\file1.avi",
|
||||
"c:\\file2.avi",
|
||||
"c:\\file3.avi",
|
||||
"c:\\file1.avi".AsOsAgnostic(),
|
||||
"c:\\file2.avi".AsOsAgnostic(),
|
||||
"c:\\file3.avi".AsOsAgnostic()
|
||||
};
|
||||
|
||||
Mocker.GetMock<IMediaFileRepository>()
|
||||
@ -45,9 +46,9 @@ public void filter_should_return_none_if_all_files_exist()
|
||||
{
|
||||
var files = new List<string>()
|
||||
{
|
||||
"c:\\file1.avi",
|
||||
"c:\\file2.avi",
|
||||
"c:\\file3.avi",
|
||||
"c:\\file1.avi".AsOsAgnostic(),
|
||||
"c:\\file2.avi".AsOsAgnostic(),
|
||||
"c:\\file3.avi".AsOsAgnostic()
|
||||
};
|
||||
|
||||
Mocker.GetMock<IMediaFileRepository>()
|
||||
@ -63,21 +64,21 @@ public void filter_should_return_none_existing_files()
|
||||
{
|
||||
var files = new List<string>()
|
||||
{
|
||||
"c:\\file1.avi",
|
||||
"c:\\file2.avi",
|
||||
"c:\\file3.avi",
|
||||
"c:\\file1.avi".AsOsAgnostic(),
|
||||
"c:\\file2.avi".AsOsAgnostic(),
|
||||
"c:\\file3.avi".AsOsAgnostic()
|
||||
};
|
||||
|
||||
Mocker.GetMock<IMediaFileRepository>()
|
||||
.Setup(c => c.GetFilesBySeries(It.IsAny<int>()))
|
||||
.Returns(new List<EpisodeFile>
|
||||
{
|
||||
new EpisodeFile{Path = "c:\\file2.avi"}
|
||||
new EpisodeFile{Path = "c:\\file2.avi".AsOsAgnostic()}
|
||||
});
|
||||
|
||||
|
||||
Subject.FilterExistingFiles(files, 10).Should().HaveCount(2);
|
||||
Subject.FilterExistingFiles(files, 10).Should().NotContain("c:\\file2.avi");
|
||||
Subject.FilterExistingFiles(files, 10).Should().NotContain("c:\\file2.avi".AsOsAgnostic());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user