mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Converted jobs to dynamic
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user