Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Testing Serverless Applications - Part 1
public interface IGetArmTemplateDirectoriesFunction : IFunction
{
}
public class GetArmTemplateDirectoriesFunction : FunctionBase, IGetArmTemplateDirectoriesFunction
{
private readonly IGitHubService _gitHubService;
public GetArmTemplateDirectoriesFunction(IGitHubService gitHubService)
{
this._gitHubService = gitHubService.ThrowIfNullOrDefault();
}
public override async Task<HttpResponseMessage> InvokeAsync<TOptions>(HttpRequestMessage req, TOptions options = default(TOptions))
{
var @params = options as GetArmTemplateDirectoriesFunctionParameterOptions;
var directories = await this._gitHubService.GetArmTemplateDirectoriesAsync(@params.Query).ConfigureAwait(false);
return this.CreateOkResponse(req, directories);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment