-
-
Save justinyoo/ad98e39d9b46cf18c34617b10a640561 to your computer and use it in GitHub Desktop.
Make Your Azure WebJobs Testable Again
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class JobHostBuilder : IJobHostBuilder | |
{ | |
private readonly IJobHostConfigurationBuilder _config; | |
private JobHost _host; | |
protected JobHostBuilder(IJobHostConfigurationBuilder config) | |
{ | |
this._config = config; | |
} | |
public IJobHostBuilder AddConfiguration(Action<JobHostConfiguration> action) | |
{ | |
this._config.AddCofiguration(action); | |
return this; | |
} | |
public void BuildHost() | |
{ | |
this._host = new JobHost(this._config.Build()); | |
} | |
public void RunAndBlock() | |
{ | |
this._host.RunAndBlock(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment