From 92a0305740ba2e7b1145b799475eabaff2207dc0 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 --- .../MediaFiles/ImportApprovedMoviesFixture.cs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedMoviesFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedMoviesFixture.cs index b85a45116..9dfd374d5 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedMoviesFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedMoviesFixture.cs @@ -316,11 +316,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 = "Transformers.2007.720p.BluRay.x264-Radarr"; var outputPath = @"C:\".AsOsAgnostic(); var localMovie = _approvedDecisions.First().LocalMovie; + localMovie.FolderMovieInfo = new ParsedMovieInfo { ReleaseTitle = name }; + localMovie.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 = "Transformers.2007.720p.BluRay.x264-Radarr"; + var outputPath = "/"; + var localMovie = _approvedDecisions.First().LocalMovie; localMovie.FolderMovieInfo = new ParsedMovieInfo { ReleaseTitle = name }; localMovie.Path = Path.Combine(outputPath, name + ".mkv");