mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
add series works again, now includes title.
This commit is contained in:
@@ -158,7 +158,7 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
var episodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.All()
|
||||
.With(e => e.Series = series)
|
||||
.With(e => e.SeriesId = series.OID)
|
||||
.With(e => e.SeriesId = series.Id)
|
||||
.With(e => e.SeasonNumber = 1)
|
||||
.Build();
|
||||
|
||||
@@ -198,7 +198,7 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
var episodes = Builder<Episode>.CreateListOfSize(10)
|
||||
.TheFirst(5)
|
||||
.With(e => e.Series = series)
|
||||
.With(e => e.SeriesId = series.OID)
|
||||
.With(e => e.SeriesId = series.Id)
|
||||
.With(e => e.SeasonNumber = 1)
|
||||
.TheNext(5)
|
||||
.With(e => e.Series = series2)
|
||||
|
||||
@@ -82,10 +82,10 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
var series = Builder<Series>.CreateNew()
|
||||
.Build();
|
||||
|
||||
Mocker.GetMock<ISeriesRepository>().Setup(s => s.Get(series.OID))
|
||||
Mocker.GetMock<ISeriesRepository>().Setup(s => s.Get(series.Id))
|
||||
.Returns(series);
|
||||
|
||||
Mocker.Resolve<BannerDownloadJob>().Start(_notification, new { SeriesId = series.OID });
|
||||
Mocker.Resolve<BannerDownloadJob>().Start(_notification, new { SeriesId = series.Id });
|
||||
VerifyDownloadMock(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,12 +26,12 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
public void series_specific_scan_should_scan_series()
|
||||
{
|
||||
var series = Builder<Series>.CreateNew()
|
||||
.With(s => s.OID = 12)
|
||||
.With(s => s.Id = 12)
|
||||
.Build();
|
||||
|
||||
|
||||
Mocker.GetMock<ISeriesRepository>()
|
||||
.Setup(p => p.Get(series.OID));
|
||||
.Setup(p => p.Get(series.Id));
|
||||
|
||||
|
||||
Mocker.GetMock<DiskScanProvider>()
|
||||
@@ -39,7 +39,7 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
.Returns(new List<EpisodeFile>());
|
||||
|
||||
//Act
|
||||
Mocker.Resolve<DiskScanJob>().Start(new ProgressNotification("Test"), new { SeriesId = series.OID });
|
||||
Mocker.Resolve<DiskScanJob>().Start(new ProgressNotification("Test"), new { SeriesId = series.Id });
|
||||
|
||||
//Assert
|
||||
Mocker.VerifyAllMocks();
|
||||
@@ -51,8 +51,8 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
public void job_with_no_target_should_scan_all_series()
|
||||
{
|
||||
var series = Builder<Series>.CreateListOfSize(2)
|
||||
.TheFirst(1).With(s => s.OID = 12)
|
||||
.TheNext(1).With(s => s.OID = 15)
|
||||
.TheFirst(1).With(s => s.Id = 12)
|
||||
.TheNext(1).With(s => s.Id = 15)
|
||||
.Build().ToList();
|
||||
|
||||
Mocker.GetMock<ISeriesRepository>()
|
||||
@@ -77,8 +77,8 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
public void failed_scan_should_not_terminated_job()
|
||||
{
|
||||
var series = Builder<Series>.CreateListOfSize(2)
|
||||
.TheFirst(1).With(s => s.OID = 12)
|
||||
.TheNext(1).With(s => s.OID = 15)
|
||||
.TheFirst(1).With(s => s.Id = 12)
|
||||
.TheNext(1).With(s => s.Id = 15)
|
||||
.Build().ToList();
|
||||
|
||||
Mocker.GetMock<ISeriesRepository>()
|
||||
@@ -104,8 +104,8 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
public void job_with_no_target_should_scan_series_with_episodes()
|
||||
{
|
||||
var series = Builder<Series>.CreateListOfSize(2)
|
||||
.TheFirst(1).With(s => s.OID = 12)
|
||||
.TheNext(1).With(s => s.OID = 15)
|
||||
.TheFirst(1).With(s => s.Id = 12)
|
||||
.TheNext(1).With(s => s.Id = 15)
|
||||
.Build().ToList();
|
||||
|
||||
Mocker.GetMock<ISeriesRepository>()
|
||||
|
||||
@@ -26,8 +26,8 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
{
|
||||
var series = Builder<Series>.CreateListOfSize(2)
|
||||
.All().With(s => s.LastInfoSync = null)
|
||||
.TheFirst(1).With(s => s.OID = 12)
|
||||
.TheNext(1).With(s => s.OID = 15)
|
||||
.TheFirst(1).With(s => s.Id = 12)
|
||||
.TheNext(1).With(s => s.Id = 15)
|
||||
.Build();
|
||||
|
||||
var notification = new ProgressNotification("Test");
|
||||
@@ -40,11 +40,11 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
|
||||
|
||||
Mocker.GetMock<DiskScanJob>()
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)))
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)))
|
||||
.Callback(() => series[0].LastDiskSync = DateTime.Now);
|
||||
|
||||
Mocker.GetMock<DiskScanJob>()
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].OID)))
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].Id)))
|
||||
.Callback(() => series[1].LastDiskSync = DateTime.Now);
|
||||
|
||||
Mocker.GetMock<BannerDownloadJob>()
|
||||
@@ -54,18 +54,18 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") > 0)));
|
||||
|
||||
Mocker.GetMock<UpdateInfoJob>()
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)))
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)))
|
||||
.Callback(() => series[0].LastInfoSync = DateTime.Now);
|
||||
|
||||
Mocker.GetMock<UpdateInfoJob>()
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].OID)))
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].Id)))
|
||||
.Callback(() => series[1].LastInfoSync = DateTime.Now);
|
||||
|
||||
Mocker.GetMock<ISeriesRepository>()
|
||||
.Setup(s => s.Get(series[0].OID)).Returns(series[0]);
|
||||
.Setup(s => s.Get(series[0].Id)).Returns(series[0]);
|
||||
|
||||
Mocker.GetMock<ISeriesRepository>()
|
||||
.Setup(s => s.Get(series[1].OID)).Returns(series[1]);
|
||||
.Setup(s => s.Get(series[1].Id)).Returns(series[1]);
|
||||
|
||||
Mocker.GetMock<MediaFileProvider>()
|
||||
.Setup(s => s.GetSeriesFiles(It.IsAny<int>())).Returns(new List<EpisodeFile>());
|
||||
@@ -74,11 +74,11 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
Mocker.Resolve<ImportNewSeriesJob>().Start(notification, null);
|
||||
|
||||
//Assert
|
||||
Mocker.GetMock<DiskScanJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)), Times.Once());
|
||||
Mocker.GetMock<DiskScanJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].OID)), Times.Once());
|
||||
Mocker.GetMock<DiskScanJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)), Times.Once());
|
||||
Mocker.GetMock<DiskScanJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].Id)), Times.Once());
|
||||
|
||||
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)), Times.Once());
|
||||
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].OID)), Times.Once());
|
||||
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)), Times.Once());
|
||||
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].Id)), Times.Once());
|
||||
|
||||
}
|
||||
|
||||
@@ -91,8 +91,8 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
{
|
||||
var series = Builder<Series>.CreateListOfSize(2)
|
||||
.All().With(s => s.LastInfoSync = null)
|
||||
.TheFirst(1).With(s => s.OID = 12)
|
||||
.TheNext(1).With(s => s.OID = 15)
|
||||
.TheFirst(1).With(s => s.Id = 12)
|
||||
.TheNext(1).With(s => s.Id = 15)
|
||||
.Build();
|
||||
|
||||
var notification = new ProgressNotification("Test");
|
||||
@@ -104,37 +104,37 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
.Returns(series);
|
||||
|
||||
Mocker.GetMock<UpdateInfoJob>()
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)))
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)))
|
||||
.Callback(() => series[0].LastInfoSync = DateTime.Now);
|
||||
|
||||
Mocker.GetMock<UpdateInfoJob>()
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].OID)))
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].Id)))
|
||||
.Throws(new InvalidOperationException());
|
||||
|
||||
Mocker.GetMock<DiskScanJob>()
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)))
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)))
|
||||
.Callback(() => series[0].LastDiskSync = DateTime.Now);
|
||||
|
||||
Mocker.GetMock<BannerDownloadJob>()
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)));
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)));
|
||||
|
||||
Mocker.GetMock<ISeriesRepository>()
|
||||
.Setup(s => s.Get(series[0].OID)).Returns(series[0]);
|
||||
.Setup(s => s.Get(series[0].Id)).Returns(series[0]);
|
||||
|
||||
Mocker.GetMock<MediaFileProvider>()
|
||||
.Setup(s => s.GetSeriesFiles(It.IsAny<int>())).Returns(new List<EpisodeFile>());
|
||||
|
||||
Mocker.GetMock<XemUpdateJob>()
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)));
|
||||
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)));
|
||||
|
||||
//Act
|
||||
Mocker.Resolve<ImportNewSeriesJob>().Start(notification, null);
|
||||
|
||||
//Assert
|
||||
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)), Times.Once());
|
||||
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].OID)), Times.Once());
|
||||
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)), Times.Once());
|
||||
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].Id)), Times.Once());
|
||||
|
||||
Mocker.GetMock<DiskScanJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)), Times.Once());
|
||||
Mocker.GetMock<DiskScanJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)), Times.Once());
|
||||
|
||||
ExceptionVerification.ExpectedErrors(1);
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
Subject.Init();
|
||||
|
||||
var deletedJob = Builder<JobDefinition>.CreateNew()
|
||||
.With(c => c.OID = 0)
|
||||
.With(c => c.Id = 0)
|
||||
.Build();
|
||||
|
||||
Db.Insert(deletedJob);
|
||||
@@ -80,7 +80,7 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
|
||||
var deletedJob = Builder<JobDefinition>.CreateNew()
|
||||
.With(c => c.Name = _fakeJob.Name)
|
||||
.With(c => c.OID = 0)
|
||||
.With(c => c.Id = 0)
|
||||
.Build();
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
{
|
||||
|
||||
var oldJob = Builder<JobDefinition>.CreateNew()
|
||||
.With(c => c.OID = 0)
|
||||
.With(c => c.Id = 0)
|
||||
.With(c => c.Name = "OldName")
|
||||
.With(c => c.TypeName = typeof(FakeJob).ToString())
|
||||
.With(c => c.Interval = 0)
|
||||
|
||||
@@ -37,11 +37,11 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
.Build();
|
||||
|
||||
Mocker.GetMock<ISeriesRepository>()
|
||||
.Setup(s => s.Get(_series.OID))
|
||||
.Setup(s => s.Get(_series.Id))
|
||||
.Returns(_series);
|
||||
|
||||
Mocker.GetMock<MediaFileProvider>()
|
||||
.Setup(s => s.GetSeasonFiles(_series.OID, 5))
|
||||
.Setup(s => s.GetSeasonFiles(_series.Id, 5))
|
||||
.Returns(_episodeFiles);
|
||||
}
|
||||
|
||||
@@ -63,13 +63,13 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
public void should_throw_if_seasonId_is_less_than_zero()
|
||||
{
|
||||
Assert.Throws<ArgumentException>(() =>
|
||||
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.OID, SeasonNumber = -10 }));
|
||||
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.Id, SeasonNumber = -10 }));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_log_warning_if_no_episode_files_are_found()
|
||||
{
|
||||
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.OID, SeasonNumber = 10 });
|
||||
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.Id, SeasonNumber = 10 });
|
||||
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
@@ -77,7 +77,7 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
[Test]
|
||||
public void should_return_if_no_episodes_are_moved()
|
||||
{
|
||||
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.OID, SeasonNumber = 5 });
|
||||
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.Id, SeasonNumber = 5 });
|
||||
|
||||
Mocker.GetMock<MetadataProvider>().Verify(v => v.RemoveForEpisodeFiles(It.IsAny<List<EpisodeFile>>()), Times.Never());
|
||||
}
|
||||
@@ -86,7 +86,7 @@ namespace NzbDrone.Core.Test.JobTests
|
||||
public void should_return_process_metadata_if_files_are_moved()
|
||||
{
|
||||
WithMovedFiles();
|
||||
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.OID, SeasonNumber = 5 });
|
||||
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.Id, SeasonNumber = 5 });
|
||||
|
||||
Mocker.GetMock<MetadataProvider>().Verify(v => v.RemoveForEpisodeFiles(It.IsAny<List<EpisodeFile>>()), Times.Once());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user