Sunday, October 18, 2020

xUnit in AWS


xUnit.net is a free and open-source unit testing tool for the .NET Framework, written by the original author of NUnit. It is licensed under Apache License 2.0 and the source code is available on GitHub. xUnit.net works with Xamarin, ReSharper, CodeRush, and TestDriven.NET.

The best practice is to write repeatable and automated tests to ensure that your functions stay correct as you make changes to them using frameworks like xUnit.net. The programming model for Lambda is simple enough that testing is generally no different from testing your class libraries. Most of the Lambda blueprints provided in Visual Studio have the option to create an accompanying xUnit.net test project.

There are times when quick ad-hoc testing is necessary. To help with ad-hoc testing, we recently released the AWS .NET Mock Lambda Test Tool. This tool isn’t a local Lambda runtime. It’s a tool to quickly load up your Lambda function code and test your application logic. It provides functionality similar to the quick F5 debugging experience.

Because the tool is a .NET Core application that loads your code into its process, any IDE that can debug .NET Core can attach to this tool and enable you to debug your Lambda functions. The latest version of the AWS Toolkit for Visual Studio takes care of configuring the Lambda test tool as the debug target when you open a .NET Core Lambda project.

No comments:

Post a Comment