mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Converted jobs to dynamic
This commit is contained in:
parent
93402f4932
commit
a4dde81ceb
42 changed files with 166 additions and 170 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue