All tests now use base class Mocker

This commit is contained in:
kay.one 2011-12-14 20:15:53 -08:00
commit 1b45a85f3f
39 changed files with 1002 additions and 1010 deletions

View file

@ -19,25 +19,25 @@ namespace NzbDrone.Core.Test.JobTests
{
var seasons = new List<int> { 1, 2, 3, 4, 5 };
var mocker = new AutoMoqer(MockBehavior.Strict);
WithStrictMocker();
var notification = new ProgressNotification("Series Search");
mocker.GetMock<EpisodeProvider>()
Mocker.GetMock<EpisodeProvider>()
.Setup(c => c.GetSeasons(1)).Returns(seasons);
mocker.GetMock<EpisodeProvider>()
Mocker.GetMock<EpisodeProvider>()
.Setup(c => c.IsIgnored(It.IsAny<int>(), It.IsAny<int>())).Returns(false);
mocker.GetMock<SeasonSearchJob>()
Mocker.GetMock<SeasonSearchJob>()
.Setup(c => c.Start(notification, 1, It.IsAny<int>())).Verifiable();
//Act
mocker.Resolve<SeriesSearchJob>().Start(notification, 1, 0);
Mocker.Resolve<SeriesSearchJob>().Start(notification, 1, 0);
//Assert
mocker.VerifyAllMocks();
mocker.GetMock<SeasonSearchJob>().Verify(c => c.Start(notification, 1, It.IsAny<int>()),
Mocker.VerifyAllMocks();
Mocker.GetMock<SeasonSearchJob>().Verify(c => c.Start(notification, 1, It.IsAny<int>()),
Times.Exactly(seasons.Count));
}
@ -46,19 +46,19 @@ namespace NzbDrone.Core.Test.JobTests
{
var seasons = new List<int>();
var mocker = new AutoMoqer(MockBehavior.Strict);
WithStrictMocker();
var notification = new ProgressNotification("Series Search");
mocker.GetMock<EpisodeProvider>()
Mocker.GetMock<EpisodeProvider>()
.Setup(c => c.GetSeasons(1)).Returns(seasons);
//Act
mocker.Resolve<SeriesSearchJob>().Start(notification, 1, 0);
Mocker.Resolve<SeriesSearchJob>().Start(notification, 1, 0);
//Assert
mocker.VerifyAllMocks();
mocker.GetMock<SeasonSearchJob>().Verify(c => c.Start(notification, 1, It.IsAny<int>()),
Mocker.VerifyAllMocks();
Mocker.GetMock<SeasonSearchJob>().Verify(c => c.Start(notification, 1, It.IsAny<int>()),
Times.Never());
}