private async Task RunTimerJobTest(Type jobClassType, Func<bool> condition) { ExplicitTypeLocator locator = new ExplicitTypeLocator(jobClassType); JobHostConfiguration config = new JobHostConfiguration { TypeLocator = locator }; config.UseTimers(); JobHost host = new JobHost(config); host.Start(); await TestHelpers.Await(() => { return condition(); }); host.Stop(); }
private async Task RunTimerJobTest(Type jobClassType, Func<bool> condition) { TestTraceWriter testTrace = new TestTraceWriter(TraceLevel.Error); ExplicitTypeLocator locator = new ExplicitTypeLocator(jobClassType); JobHostConfiguration config = new JobHostConfiguration { TypeLocator = locator }; config.UseTimers(); config.Tracing.Tracers.Add(testTrace); JobHost host = new JobHost(config); host.Start(); await TestHelpers.Await(() => { return condition(); }); host.Stop(); // ensure there were no errors Assert.Equal(0, testTrace.Events.Count); }
private JobHost CreateTestJobHost() { ExplicitTypeLocator locator = new ExplicitTypeLocator(typeof(FilesTestJobs)); JobHostConfiguration config = new JobHostConfiguration { TypeLocator = locator }; FilesConfiguration filesConfig = new FilesConfiguration { RootPath = rootPath }; config.UseFiles(filesConfig); return new JobHost(config); }
private JobHost CreateTestJobHost() { ExplicitTypeLocator locator = new ExplicitTypeLocator(typeof(FilesTestJobs)); var resolver = new TestNameResolver(); resolver.Values.Add("test", "TestValue"); JobHostConfiguration config = new JobHostConfiguration { TypeLocator = locator, NameResolver = resolver }; FilesConfiguration filesConfig = new FilesConfiguration { RootPath = rootPath }; config.UseFiles(filesConfig); return new JobHost(config); }