From ff40d82ef13e75597f3c55ca70c08bbf43dd5c4c Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 6 Sep 2020 22:40:17 -0400 Subject: [PATCH] Fixed: Edge case where import fails due to DB relationship mismatch Signed-off-by: Robin Dadswell --- .../Specifications/SameFileSpecificationFixture.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/NzbDrone.Core.Test/MediaFiles/TrackImport/Specifications/SameFileSpecificationFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/TrackImport/Specifications/SameFileSpecificationFixture.cs index ffa01c460..651b4af6a 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/TrackImport/Specifications/SameFileSpecificationFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/TrackImport/Specifications/SameFileSpecificationFixture.cs @@ -91,5 +91,18 @@ namespace NzbDrone.Core.Test.MediaFiles.BookImport.Specifications Subject.IsSatisfiedBy(_localTrack, null).Accepted.Should().BeFalse(); } + + [Test] + public void should_be_accepted_if_file_cannot_be_fetched() + { + _localTrack.Tracks = Builder.CreateListOfSize(1) + .TheFirst(1) + .With(e => e.TrackFileId = 1) + .With(e => e.TrackFile = new LazyLoaded((TrackFile)null)) + .Build() + .ToList(); + + Subject.IsSatisfiedBy(_localTrack, null).Accepted.Should().BeTrue(); + } } }