Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created September 5, 2017 13:06
Make Your Azure WebJobs Testable Again
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