Skip to Content
Azure Serverless Computing Cookbook - Second Edition
book

Azure Serverless Computing Cookbook - Second Edition

by Praveen Kumar Sreeram, Jason Marston
November 2018
Intermediate to advanced
424 pages
10h 55m
English
Packt Publishing
Content preview from Azure Serverless Computing Cookbook - Second Edition

Getting ready

We will be using the Moq mocking framework to unit test our Azure Function. Having a basic working knowledge of Moq is a requirement for this recipe. If you need to, you can learn more about Moq at https://github.com/moq/moq4/wiki.

In order to make the unit test case simple, I have commented out the lines of code that reads the data from the Post parameters to the Run method of HTTPTriggerCSharpFromVS HTTPTrigger as shown in the following with bold highlighted:

[FunctionName("HTTPTriggerCSharpFromVS")]        public static async Task<IActionResult> Run(            [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,            ILogger log)        {            log.LogInformation("C# HTTP trigger function processed a request."); string ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Azure Serverless Computing Cookbook

Azure Serverless Computing Cookbook

Praveen Kumar Sreeram
Azure Serverless Computing Cookbook - Third Edition

Azure Serverless Computing Cookbook - Third Edition

Praveen Kumar Sreeram, Kasam Shaikh, Greg Leonardo
Mastering Azure Serverless Computing

Mastering Azure Serverless Computing

Lorenzo Barbieri, Massimo Bonanni

Publisher Resources

ISBN: 9781789615265Supplemental Content