예제 #1
0
 public void GetJobArgsType()
 {
     Should.NotThrow(() => BackgroundJobArgsHelper.GetJobArgsType(typeof(AsyncBackgroundJob <string>))).ShouldBe(typeof(string));
     Should.NotThrow(() => BackgroundJobArgsHelper.GetJobArgsType(typeof(BackgroundJob <string>))).ShouldBe(typeof(string));
     Should.Throw <ScorpioException>(() => BackgroundJobArgsHelper.GetJobArgsType(typeof(DefaultServiceProviderFactory)));
     Should.Throw <ScorpioException>(() => BackgroundJobArgsHelper.GetJobArgsType(typeof(NullLogger <string>)));
 }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="jobType"></param>
 public BackgroundJobConfiguration(Type jobType)
 {
     JobType  = jobType;
     ArgsType = BackgroundJobArgsHelper.GetJobArgsType(jobType);
     JobName  = BackgroundJobNameAttribute.GetName(ArgsType);
 }