From 2c95f07cb277a8bdf3c9e87eac2132ab1dd8ff73 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 10 Jan 2019 23:26:25 -0800 Subject: [PATCH] Another path test fix --- .../ImportApprovedEpisodesFixture.cs | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedEpisodesFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedEpisodesFixture.cs index e1e5e1d5a..3186a09cc 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedEpisodesFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedEpisodesFixture.cs @@ -319,10 +319,29 @@ namespace NzbDrone.Core.Test.MediaFiles } [Test] - public void should_get_relative_path_when_there_is_no_grandparent() + public void should_get_relative_path_when_there_is_no_grandparent_windows() { + WindowsOnly(); + var name = "Series.Title.S01E01.720p.HDTV.x264-Sonarr"; - var outputPath = @"C:\".AsOsAgnostic(); + var outputPath = @"C:\"; + var localEpisode = _approvedDecisions.First().LocalEpisode; + + localEpisode.FolderEpisodeInfo = new ParsedEpisodeInfo { ReleaseTitle = name }; + localEpisode.Path = Path.Combine(outputPath, name + ".mkv"); + + Subject.Import(new List { _approvedDecisions.First() }, true, null); + + Mocker.GetMock().Verify(v => v.Add(It.Is(c => c.OriginalFilePath == $"{name}.mkv".AsOsAgnostic()))); + } + + [Test] + public void should_get_relative_path_when_there_is_no_grandparent_mono() + { + MonoOnly(); + + var name = "Series.Title.S01E01.720p.HDTV.x264-Sonarr"; + var outputPath = "/"; var localEpisode = _approvedDecisions.First().LocalEpisode; localEpisode.FolderEpisodeInfo = new ParsedEpisodeInfo { ReleaseTitle = name };