Adding Automated Tests to AWS Lambda .NET Executable
Learn how to add automated tests to an AWS Lambda application with .NET runtime.
Automated testing
Testing an AWS Lambda application with .NET runtime and top-level C# statements is more involved than testing a basic AWS Lambda console application. There are multiple ways to do it, and some are more advanced than others. For example, since the function handler is not associated with any method or class, we have to use some complicated reflections logic to identify it in our test methods. It may work, but the code we’ll end up with won’t be easily readable or understood by novice developers.
The following playground shows an easier way. This setup demonstrates how the problem may be solved by moving the business logic from the function handler into a concrete class with a concrete method.
Get hands-on with 1400+ tech skills courses.