mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Fix: Successful downloads that are not moved properly should be retried.
This commit is contained in:
parent
5650f891ee
commit
c0d1d2c502
6 changed files with 170 additions and 1 deletions
|
@ -158,5 +158,40 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
result.Should().HaveCount(9);
|
||||
result.Should().NotContain(e => e.EpisodeFileId == 1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetFileByPath_should_return_null_if_file_does_not_exist_in_database()
|
||||
{
|
||||
//Setup
|
||||
WithRealDb();
|
||||
|
||||
//Act
|
||||
var result = Mocker.Resolve<MediaFileProvider>().GetFileByPath(@"C:\Test\EpisodeFile.avi");
|
||||
|
||||
//Resolve
|
||||
result.Should().BeNull();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetFileByPath_should_return_EpisodeFile_if_file_exists_in_database()
|
||||
{
|
||||
var path = @"C:\Test\EpisodeFile.avi";
|
||||
|
||||
//Setup
|
||||
WithRealDb();
|
||||
var episodeFile = Builder<EpisodeFile>.CreateNew()
|
||||
.With(f => f.Path = path.NormalizePath())
|
||||
.Build();
|
||||
|
||||
var episodeFileId = Convert.ToInt32(Db.Insert(episodeFile));
|
||||
|
||||
//Act
|
||||
var result = Mocker.Resolve<MediaFileProvider>().GetFileByPath(path);
|
||||
|
||||
//Resolve
|
||||
result.Should().NotBeNull();
|
||||
result.Path.Should().Be(path.NormalizePath());
|
||||
result.EpisodeFileId.Should().Be(episodeFileId);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue