I am using .Net Core2.2. I've an API project with environment variables. These variables are injecting on CI.
What I want to do is, when I run my integration tests, it should fire up the API project (or fake the exact API server) and call one of the controller.
The problem is environment variables on launchSettings.json are not injecting.
My test server initialization:
var testServer = new TestServer(new WebHostBuilder()
.ConfigureAppConfiguration((hostingContext, config) =>
{
config.AddEnvironmentVariables();
})
.UseStartup<Startup>());
I've added the same launchSetting.json file into test project but it did not worked also.
What I am doing wrong? Thanks.