1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-10 04:52:42 +01:00
Radarr/NzbDrone.Core.Test/JobTests/TestJobs.cs

71 lines
1.4 KiB
C#
Raw Normal View History

2013-05-07 02:39:33 +02:00
/*
using System;
using System.Linq;
using System.Threading;
2011-12-02 02:33:17 +01:00
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Model.Notification;
namespace NzbDrone.Core.Test.JobTests
{
public class FakeJob : IJob
{
public string Name
{
get { return GetType().Name; }
}
public virtual TimeSpan DefaultInterval
{
get { return TimeSpan.FromMinutes(15); }
}
public int ExecutionCount { get; private set; }
2012-09-10 21:04:17 +02:00
public void Start(ProgressNotification notification, dynamic options)
{
ExecutionCount++;
Console.WriteLine("Begin " + Name);
Start();
Console.WriteLine("End " + Name);
}
protected virtual void Start()
{
}
}
public class DisabledJob : FakeJob
{
public override TimeSpan DefaultInterval
{
get { return TimeSpan.FromTicks(0); }
}
}
public class BrokenJob : FakeJob
{
protected override void Start()
{
throw new ApplicationException("Broken job is broken");
}
}
public class SlowJob : FakeJob
{
protected override void Start()
{
Thread.Sleep(1000);
}
}
public class SlowJob2 : FakeJob
{
protected override void Start()
{
Thread.Sleep(1000);
}
}
}
2013-05-07 02:39:33 +02:00
*/