mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 21:13:28 -07:00
Added sabtitle method
Added custom parse option to Indexrbase
This commit is contained in:
parent
9028e498ca
commit
10ad7d1ed5
13 changed files with 289 additions and 84 deletions
|
@ -50,6 +50,27 @@ namespace NzbDrone.Core.Test
|
|||
|
||||
}
|
||||
|
||||
[Test]
|
||||
//This test will confirm that the concurrency checks are rest
|
||||
//after execution so the job can successfully run.
|
||||
public void can_run_broken_job_again()
|
||||
{
|
||||
IEnumerable<IJob> fakeTimers = new List<IJob> { new BrokenJob() };
|
||||
var mocker = new AutoMoqer();
|
||||
|
||||
mocker.SetConstant(MockLib.GetEmptyRepository());
|
||||
mocker.SetConstant(fakeTimers);
|
||||
|
||||
var timerProvider = mocker.Resolve<JobProvider>();
|
||||
timerProvider.Initialize();
|
||||
var firstRun = timerProvider.RunScheduled();
|
||||
var secondRun = timerProvider.RunScheduled();
|
||||
|
||||
Assert.IsTrue(firstRun);
|
||||
Assert.IsTrue(secondRun);
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
//This test will confirm that the concurrency checks are rest
|
||||
//after execution so the job can successfully run.
|
||||
|
@ -73,6 +94,28 @@ namespace NzbDrone.Core.Test
|
|||
}
|
||||
|
||||
|
||||
[Test]
|
||||
//This test will confirm that the concurrency checks are rest
|
||||
//after execution so the job can successfully run.
|
||||
public void can_run_broken_async_job_again()
|
||||
{
|
||||
IEnumerable<IJob> fakeTimers = new List<IJob> { new BrokenJob() };
|
||||
var mocker = new AutoMoqer();
|
||||
|
||||
mocker.SetConstant(MockLib.GetEmptyRepository());
|
||||
mocker.SetConstant(fakeTimers);
|
||||
|
||||
var timerProvider = mocker.Resolve<JobProvider>();
|
||||
timerProvider.Initialize();
|
||||
var firstRun = timerProvider.BeginExecute(typeof(FakeJob));
|
||||
Thread.Sleep(2000);
|
||||
var secondRun = timerProvider.BeginExecute(typeof(FakeJob));
|
||||
|
||||
Assert.IsTrue(firstRun);
|
||||
Assert.IsTrue(secondRun);
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
//This test will confirm that the concurrency checks are rest
|
||||
//after execution so the job can successfully run.
|
||||
|
@ -183,6 +226,24 @@ namespace NzbDrone.Core.Test
|
|||
}
|
||||
}
|
||||
|
||||
public class BrokenJob : IJob
|
||||
{
|
||||
public string Name
|
||||
{
|
||||
get { return "FakeJob"; }
|
||||
}
|
||||
|
||||
public int DefaultInterval
|
||||
{
|
||||
get { return 15; }
|
||||
}
|
||||
|
||||
public void Start(ProgressNotification notification, int targetId)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
public class SlowJob : IJob
|
||||
{
|
||||
public string Name
|
||||
|
@ -197,7 +258,7 @@ namespace NzbDrone.Core.Test
|
|||
|
||||
public void Start(ProgressNotification notification, int targetId)
|
||||
{
|
||||
Thread.Sleep(10000);
|
||||
Thread.Sleep(5000);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue