Converted jobs to dynamic

This commit is contained in:
Mark McDowall 2012-09-10 12:04:17 -07:00
commit a4dde81ceb
42 changed files with 166 additions and 170 deletions

View file

@ -30,14 +30,14 @@ namespace NzbDrone.Core.Test.JobTests
.Setup(c => c.IsIgnored(It.IsAny<int>(), It.IsAny<int>())).Returns(false);
Mocker.GetMock<SeasonSearchJob>()
.Setup(c => c.Start(notification, 1, It.IsAny<int>())).Verifiable();
.Setup(c => c.Start(notification, new { SeriesId = 1, SeasonNumber = It.IsAny<int>() })).Verifiable();
//Act
Mocker.Resolve<SeriesSearchJob>().Start(notification, 1, 0);
Mocker.Resolve<SeriesSearchJob>().Start(notification, new { SeriesId = 1 });
//Assert
Mocker.VerifyAllMocks();
Mocker.GetMock<SeasonSearchJob>().Verify(c => c.Start(notification, 1, It.IsAny<int>()),
Mocker.GetMock<SeasonSearchJob>().Verify(c => c.Start(notification, new { SeriesId = 1, SeasonNumber = It.IsAny<int>() }),
Times.Exactly(seasons.Count));
}
@ -54,11 +54,11 @@ namespace NzbDrone.Core.Test.JobTests
.Setup(c => c.GetSeasons(1)).Returns(seasons);
//Act
Mocker.Resolve<SeriesSearchJob>().Start(notification, 1, 0);
Mocker.Resolve<SeriesSearchJob>().Start(notification, new { SeriesId = 1 });
//Assert
Mocker.VerifyAllMocks();
Mocker.GetMock<SeasonSearchJob>().Verify(c => c.Start(notification, 1, It.IsAny<int>()),
Mocker.GetMock<SeasonSearchJob>().Verify(c => c.Start(notification, new { SeriesId = 1, SeasonNumber = It.IsAny<int>() }),
Times.Never());
}
@ -69,11 +69,11 @@ namespace NzbDrone.Core.Test.JobTests
.Setup(c => c.GetSeasons(It.IsAny<int>()))
.Returns(new List<int> { 0, 1, 2 });
Mocker.Resolve<SeriesSearchJob>().Start(MockNotification, 12, 0);
Mocker.Resolve<SeriesSearchJob>().Start(MockNotification, new { SeriesId = 12 });
Mocker.GetMock<SeasonSearchJob>()
.Verify(c => c.Start(It.IsAny<ProgressNotification>(), It.IsAny<int>(), 0), Times.Never());
.Verify(c => c.Start(It.IsAny<ProgressNotification>(), new { SeriesId = It.IsAny<int>(), SeasonNumber = 0 }), Times.Never());
}
}
}