fixed broken tests

This commit is contained in:
kay.one 2011-05-22 22:51:46 -07:00
parent 7b56711a4f
commit 8ba42106c4
2 changed files with 7 additions and 4 deletions

View File

@ -324,12 +324,15 @@ namespace NzbDrone.Core.Test
public void scan_media_job_should_not_scan_new_series()
{
var mocker = new AutoMoqer();
IQueryable<Series> fakeSeries = Builder<Series>.CreateListOfSize(2)
.WhereTheFirst(1).Has(c => c.Episodes = new List<Episode>())
.AndTheNext(1).Has(c => c.Episodes = Builder<Episode>.CreateListOfSize(10).Build())
.Build().AsQueryable();
mocker.GetMock<SeriesProvider>()
.Setup(c => c.GetAllSeries())
.Returns(Builder<Series>.CreateListOfSize(2)
.WhereTheFirst(1).Has(c => c.LastInfoSync = DateTime.Now).Build().AsQueryable());
.Setup(c => c.GetAllSeries()).Returns(fakeSeries);
mocker.GetMock<MediaFileProvider>(MockBehavior.Strict)
.Setup(c => c.Scan(It.Is<Series>(s => s.LastInfoSync != null))).Returns(new List<EpisodeFile>()).Verifiable();
.Setup(c => c.Scan(fakeSeries.ToList()[1])).Returns(new List<EpisodeFile>()).Verifiable();
mocker.Resolve<DiskScanJob>().Start(new ProgressNotification("test"), 0);