This will exmaple to create new Azure Functions with UnitTest
- C#
- Azure Functions
- XUnit
- GitHub Actions
The project requires .NET 6.0
Tested on:
- Visual Studio Code (1.74.3)
From the terminal/shell/command line tool, use the following commands to build, test and run the API.
$ dotnet build
$ dotnet test
Useful commands to test Azure Functions locally more info
# Run functions locally
$ func start
# Deploy project files
$ func azure functionapp publish <FunctionAppName>
# install dotnet coverage
$ dotnet tool install --global dotnet-coverage
# running code coverage
# from /src directory
$ dotnet-coverage collect 'dotnet test' -f xml -o 'coverage.xml'
Integration test