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>))); }
/// <summary> /// /// </summary> /// <param name="jobType"></param> public BackgroundJobConfiguration(Type jobType) { JobType = jobType; ArgsType = BackgroundJobArgsHelper.GetJobArgsType(jobType); JobName = BackgroundJobNameAttribute.GetName(ArgsType); }