mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
All tests now use base class Mocker
This commit is contained in:
parent
ab29a114d1
commit
1b45a85f3f
39 changed files with 1002 additions and 1010 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue