2011-10-20 16:42:17 -07:00
|
|
|
using System;
|
2011-11-13 16:22:18 -08:00
|
|
|
|
2011-08-27 22:45:36 -07:00
|
|
|
using Moq;
|
|
|
|
using NUnit.Framework;
|
2011-12-01 17:33:17 -08:00
|
|
|
using NzbDrone.Core.Jobs;
|
2011-08-27 22:45:36 -07:00
|
|
|
using NzbDrone.Core.Model.Notification;
|
2011-12-14 20:15:53 -08:00
|
|
|
using NzbDrone.Core.Test.Framework;
|
2011-11-13 16:22:18 -08:00
|
|
|
using NzbDrone.Test.Common.AutoMoq;
|
2011-08-27 22:45:36 -07:00
|
|
|
|
2011-10-20 16:42:17 -07:00
|
|
|
namespace NzbDrone.Core.Test.JobTests
|
2011-08-27 22:45:36 -07:00
|
|
|
{
|
|
|
|
[TestFixture]
|
2011-12-14 20:15:53 -08:00
|
|
|
public class SearchJobTest:CoreTest
|
2011-08-27 22:45:36 -07:00
|
|
|
{
|
|
|
|
[TestCase(0)]
|
|
|
|
[TestCase(-1)]
|
|
|
|
[TestCase(-100)]
|
|
|
|
[ExpectedException(typeof(ArgumentOutOfRangeException))]
|
|
|
|
public void start_target_id_less_than_0_throws_exception(int target)
|
|
|
|
{
|
2011-12-14 20:15:53 -08:00
|
|
|
WithStrictMocker();
|
|
|
|
Mocker.Resolve<EpisodeSearchJob>().Start(new ProgressNotification("Test"), target, 0);
|
2011-08-27 22:45:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
[TestCase(0)]
|
|
|
|
[TestCase(-1)]
|
|
|
|
[TestCase(-100)]
|
|
|
|
[ExpectedException(typeof(ArgumentOutOfRangeException))]
|
|
|
|
public void start_secondary_target_id_less_than_0_throws_exception(int target)
|
|
|
|
{
|
2011-12-14 20:15:53 -08:00
|
|
|
WithStrictMocker();
|
|
|
|
Mocker.Resolve<SeasonSearchJob>().Start(new ProgressNotification("Test"), 0, target);
|
2011-08-27 22:45:36 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|