You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
770 B
31 lines
770 B
using System; |
|
using System.Threading.Tasks; |
|
using DotXxlJob.Core.DefaultHandlers; |
|
using DotXxlJob.Core.Model; |
|
using Xunit; |
|
|
|
namespace DotXxlJob.Core.Tests |
|
{ |
|
public class JobHandlerCacheTest |
|
{ |
|
[Fact] |
|
public void Repeated_Job_Handler() |
|
{ |
|
var cache = new JobHandlerCache(); |
|
|
|
cache.AddJobHandler<SimpleHttpJobHandler>(); |
|
|
|
Assert.Throws<ArgumentException>(() => cache.AddJobHandler("simpleHttpJobHandler", new TestJobHandler())); |
|
} |
|
|
|
private class TestJobHandler : IJobHandler |
|
{ |
|
public void Dispose() { } |
|
|
|
public Task<ReturnT> Execute(JobExecuteContext context) |
|
{ |
|
throw new NotImplementedException(); |
|
} |
|
} |
|
} |
|
} |