From 324195eb233a8e1583e21c744244a92a45c1f59b Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Thu, 25 Jul 2013 23:32:41 -0700 Subject: [PATCH] more linux fixes --- NzbDrone.Common.Test/PathExtensionFixture.cs | 4 +++- .../MediaFileTests/MediaFileServiceTest.cs | 23 ++++++++++--------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/NzbDrone.Common.Test/PathExtensionFixture.cs b/NzbDrone.Common.Test/PathExtensionFixture.cs index 3e66e4773..f8ca1b8ae 100644 --- a/NzbDrone.Common.Test/PathExtensionFixture.cs +++ b/NzbDrone.Common.Test/PathExtensionFixture.cs @@ -81,6 +81,7 @@ namespace NzbDrone.Common.Test [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 @@ namespace NzbDrone.Common.Test [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 @@ namespace NzbDrone.Common.Test [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); diff --git a/NzbDrone.Core.Test/MediaFileTests/MediaFileServiceTest.cs b/NzbDrone.Core.Test/MediaFileTests/MediaFileServiceTest.cs index e9b876e27..70fae670e 100644 --- a/NzbDrone.Core.Test/MediaFileTests/MediaFileServiceTest.cs +++ b/NzbDrone.Core.Test/MediaFileTests/MediaFileServiceTest.cs @@ -6,6 +6,7 @@ using NUnit.Framework; 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 @@ namespace NzbDrone.Core.Test.MediaFileTests { var files = new List() { - "c:\\file1.avi", - "c:\\file2.avi", - "c:\\file3.avi", + "c:\\file1.avi".AsOsAgnostic(), + "c:\\file2.avi".AsOsAgnostic(), + "c:\\file3.avi".AsOsAgnostic() }; Mocker.GetMock() @@ -45,9 +46,9 @@ namespace NzbDrone.Core.Test.MediaFileTests { var files = new List() { - "c:\\file1.avi", - "c:\\file2.avi", - "c:\\file3.avi", + "c:\\file1.avi".AsOsAgnostic(), + "c:\\file2.avi".AsOsAgnostic(), + "c:\\file3.avi".AsOsAgnostic() }; Mocker.GetMock() @@ -63,21 +64,21 @@ namespace NzbDrone.Core.Test.MediaFileTests { var files = new List() { - "c:\\file1.avi", - "c:\\file2.avi", - "c:\\file3.avi", + "c:\\file1.avi".AsOsAgnostic(), + "c:\\file2.avi".AsOsAgnostic(), + "c:\\file3.avi".AsOsAgnostic() }; Mocker.GetMock() .Setup(c => c.GetFilesBySeries(It.IsAny())) .Returns(new List { - 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()); } } } \ No newline at end of file