Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created July 19, 2017 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinyoo/9ef909bc84965df1c24a84d4a74f60c3 to your computer and use it in GitHub Desktop.
Save justinyoo/9ef909bc84965df1c24a84d4a74f60c3 to your computer and use it in GitHub Desktop.
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