mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-12-30 17:48:52 +01:00
FilterExistingFiles no longer converts paths to all lower case
This commit is contained in:
@@ -81,12 +81,11 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
||||
Subject.FilterExistingFiles(files, 10).Should().NotContain("c:\\file2.avi".AsOsAgnostic());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
[Test]
|
||||
public void filter_should_return_none_existing_files_ignoring_case()
|
||||
{
|
||||
WindowsOnly();
|
||||
|
||||
var files = new List<string>()
|
||||
{
|
||||
"c:\\file1.avi".AsOsAgnostic(),
|
||||
@@ -105,5 +104,44 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
||||
Subject.FilterExistingFiles(files, 10).Should().HaveCount(2);
|
||||
Subject.FilterExistingFiles(files, 10).Should().NotContain("c:\\file2.avi".AsOsAgnostic());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void filter_should_return_none_existing_files_not_ignoring_case()
|
||||
{
|
||||
LinuxOnly();
|
||||
|
||||
var files = new List<string>()
|
||||
{
|
||||
"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".AsOsAgnostic()}
|
||||
});
|
||||
|
||||
Subject.FilterExistingFiles(files, 10).Should().HaveCount(3);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void filter_should_not_change_casing()
|
||||
{
|
||||
var files = new List<string>()
|
||||
{
|
||||
"c:\\FILE1.avi".AsOsAgnostic()
|
||||
};
|
||||
|
||||
Mocker.GetMock<IMediaFileRepository>()
|
||||
.Setup(c => c.GetFilesBySeries(It.IsAny<int>()))
|
||||
.Returns(new List<EpisodeFile>());
|
||||
|
||||
Subject.FilterExistingFiles(files, 10).Should().HaveCount(1);
|
||||
Subject.FilterExistingFiles(files, 10).Should().NotContain(files.First().ToLower());
|
||||
Subject.FilterExistingFiles(files, 10).Should().Contain(files.First());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user