Environment Variables from launchsettings.json AWS Lambda Function Test .Net Core 3.1

Viewed 47

I must develop some tests for my AWS Lambda Function written in c# using .net core 3.1.

The lambda uses several environment variables that I have written on the launchsettings.json file for the local test.

I don't know why when running the application and using the "Mock Lambda test tool" all the values are retrieved and it works but when running the test from Test Explorer I have seen

var variable = Environment.GetEnvironmentVariable("variableName");

is equal to null.

How can I let the lambda retrieve these values during the integration tests?

Thanks to everyone

0 Answers
Related