diff --git a/NzbDrone.Core.Test/MediaFileProviderTests.cs b/NzbDrone.Core.Test/MediaFileProviderTests.cs index 17e3e4a7f..f0f799f33 100644 --- a/NzbDrone.Core.Test/MediaFileProviderTests.cs +++ b/NzbDrone.Core.Test/MediaFileProviderTests.cs @@ -154,5 +154,25 @@ public void CalculateFilePath_SeasonFolder_SingleNumber(string filename, int sea //Assert Assert.AreEqual(expectedPath, result.FullName); } + + [Test] + public void DeleteEpisodeFile() + { + //Setup + var episodeFiles = Builder.CreateListOfSize(10).Build(); + + var mocker = new AutoMoqer(); + var database = MockLib.GetEmptyDatabase(true); + mocker.SetConstant(database); + database.InsertMany(episodeFiles); + + //Act + mocker.Resolve().Delete(1); + var result = database.Fetch(); + + //Assert + result.Should().HaveCount(9); + result.Should().NotContain(e => e.EpisodeFileId == 1); + } } } \ No newline at end of file diff --git a/NzbDrone.Core/Providers/MediaFileProvider.cs b/NzbDrone.Core/Providers/MediaFileProvider.cs index 2429cd71b..1ab2bb4d3 100644 --- a/NzbDrone.Core/Providers/MediaFileProvider.cs +++ b/NzbDrone.Core/Providers/MediaFileProvider.cs @@ -45,7 +45,7 @@ public virtual void Update(EpisodeFile episodeFile) public virtual void Delete(int episodeFileId) { - _database.Delete(episodeFileId); + _database.Delete(episodeFileId); } public virtual bool Exists(string path)