So far, we have created multiple Azure Functions and validated their functionality using different tools. The functionalities of the functions that we have developed so far is pretty simple and straightforward; however, in your real-world applications, it won't be that simple—there will likely be many changes to the code that we initially created. It's good practice to write automated unit tests that can help us in testing the functionality of our Azure Functions. Every time we run these automated unit tests, we can test all the various paths within the code.
In this recipe, we will learn how to use the basic HTTP trigger, and see how easy it is to write automated unit test cases for this using Visual Studio Test Explorer and Moq (an open source framework available as a NuGet package).
...