mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-27 18:17:13 +00:00
Fixed broken tests.
This commit is contained in:
parent
bb5febaade
commit
a827199902
2 changed files with 9 additions and 3 deletions
|
@ -26,6 +26,9 @@ public void scan_series_should_update_last_scan_date()
|
||||||
.Setup(c => c.GetEpisodeBySeries(It.IsAny<long>()))
|
.Setup(c => c.GetEpisodeBySeries(It.IsAny<long>()))
|
||||||
.Returns(new List<Episode> { new Episode() });
|
.Returns(new List<Episode> { new Episode() });
|
||||||
|
|
||||||
|
mocker.GetMock<DiskProvider>()
|
||||||
|
.Setup(c => c.FolderExists(It.IsAny<string>()))
|
||||||
|
.Returns(true);
|
||||||
|
|
||||||
mocker.GetMock<MediaFileProvider>()
|
mocker.GetMock<MediaFileProvider>()
|
||||||
.Setup(c => c.GetSeriesFiles(It.IsAny<int>()))
|
.Setup(c => c.GetSeriesFiles(It.IsAny<int>()))
|
||||||
|
|
|
@ -76,6 +76,9 @@ public void Scan_series_should_skip_series_with_no_episodes()
|
||||||
{
|
{
|
||||||
var mocker = new AutoMoqer(MockBehavior.Strict);
|
var mocker = new AutoMoqer(MockBehavior.Strict);
|
||||||
|
|
||||||
|
var series = Builder<Series>.CreateNew()
|
||||||
|
.With(s => s.SeriesId = 12).Build();
|
||||||
|
|
||||||
mocker.GetMock<EpisodeProvider>()
|
mocker.GetMock<EpisodeProvider>()
|
||||||
.Setup(c => c.GetEpisodeBySeries(12))
|
.Setup(c => c.GetEpisodeBySeries(12))
|
||||||
.Returns(new List<Episode>());
|
.Returns(new List<Episode>());
|
||||||
|
@ -85,9 +88,9 @@ public void Scan_series_should_skip_series_with_no_episodes()
|
||||||
mocker.GetMock<MediaFileProvider>()
|
mocker.GetMock<MediaFileProvider>()
|
||||||
.Setup(e => e.DeleteOrphaned()).Returns(0);
|
.Setup(e => e.DeleteOrphaned()).Returns(0);
|
||||||
|
|
||||||
|
mocker.GetMock<DiskProvider>()
|
||||||
var series = Builder<Series>.CreateNew()
|
.Setup(s => s.FolderExists(series.Path))
|
||||||
.With(s => s.SeriesId = 12).Build();
|
.Returns(true);
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
mocker.Resolve<DiskScanProvider>().Scan(series);
|
mocker.Resolve<DiskScanProvider>().Scan(series);
|
||||||
|
|
Loading…
Reference in a new issue