more linux fixes

pull/6/head
kay.one 11 years ago
parent aee31d1bc2
commit 324195eb23

@ -81,6 +81,7 @@ namespace NzbDrone.Common.Test
[Test] [Test]
public void get_actual_casing_should_return_actual_casing_for_local_file_in_windows() public void get_actual_casing_should_return_actual_casing_for_local_file_in_windows()
{ {
WindowsOnly();
var path = Process.GetCurrentProcess().MainModule.FileName; var path = Process.GetCurrentProcess().MainModule.FileName;
path.ToUpper().GetActualCasing().Should().Be(path); path.ToUpper().GetActualCasing().Should().Be(path);
path.ToLower().GetActualCasing().Should().Be(path); path.ToLower().GetActualCasing().Should().Be(path);
@ -89,6 +90,7 @@ namespace NzbDrone.Common.Test
[Test] [Test]
public void get_actual_casing_should_return_origibal_value_in_linux() public void get_actual_casing_should_return_origibal_value_in_linux()
{ {
LinuxOnly();
var path = Process.GetCurrentProcess().MainModule.FileName; var path = Process.GetCurrentProcess().MainModule.FileName;
path.GetActualCasing().Should().Be(path); path.GetActualCasing().Should().Be(path);
path.GetActualCasing().Should().Be(path); path.GetActualCasing().Should().Be(path);
@ -107,7 +109,7 @@ namespace NzbDrone.Common.Test
[Test] [Test]
public void get_actual_casing_should_return_original_value_in_linux() public void get_actual_casing_should_return_original_value_in_linux()
{ {
WindowsOnly(); LinuxOnly();
var path = Directory.GetCurrentDirectory(); var path = Directory.GetCurrentDirectory();
path.GetActualCasing().Should().Be(path); path.GetActualCasing().Should().Be(path);
path.GetActualCasing().Should().Be(path); path.GetActualCasing().Should().Be(path);

@ -6,6 +6,7 @@ using NUnit.Framework;
using NzbDrone.Core.MediaFiles; using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Organizer; using NzbDrone.Core.Organizer;
using NzbDrone.Core.Test.Framework; using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.MediaFileTests namespace NzbDrone.Core.Test.MediaFileTests
{ {
@ -26,9 +27,9 @@ namespace NzbDrone.Core.Test.MediaFileTests
{ {
var files = new List<string>() var files = new List<string>()
{ {
"c:\\file1.avi", "c:\\file1.avi".AsOsAgnostic(),
"c:\\file2.avi", "c:\\file2.avi".AsOsAgnostic(),
"c:\\file3.avi", "c:\\file3.avi".AsOsAgnostic()
}; };
Mocker.GetMock<IMediaFileRepository>() Mocker.GetMock<IMediaFileRepository>()
@ -45,9 +46,9 @@ namespace NzbDrone.Core.Test.MediaFileTests
{ {
var files = new List<string>() var files = new List<string>()
{ {
"c:\\file1.avi", "c:\\file1.avi".AsOsAgnostic(),
"c:\\file2.avi", "c:\\file2.avi".AsOsAgnostic(),
"c:\\file3.avi", "c:\\file3.avi".AsOsAgnostic()
}; };
Mocker.GetMock<IMediaFileRepository>() Mocker.GetMock<IMediaFileRepository>()
@ -63,21 +64,21 @@ namespace NzbDrone.Core.Test.MediaFileTests
{ {
var files = new List<string>() var files = new List<string>()
{ {
"c:\\file1.avi", "c:\\file1.avi".AsOsAgnostic(),
"c:\\file2.avi", "c:\\file2.avi".AsOsAgnostic(),
"c:\\file3.avi", "c:\\file3.avi".AsOsAgnostic()
}; };
Mocker.GetMock<IMediaFileRepository>() Mocker.GetMock<IMediaFileRepository>()
.Setup(c => c.GetFilesBySeries(It.IsAny<int>())) .Setup(c => c.GetFilesBySeries(It.IsAny<int>()))
.Returns(new List<EpisodeFile> .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().HaveCount(2);
Subject.FilterExistingFiles(files, 10).Should().NotContain("c:\\file2.avi"); Subject.FilterExistingFiles(files, 10).Should().NotContain("c:\\file2.avi".AsOsAgnostic());
} }
} }
} }
Loading…
Cancel
Save