diff --git a/src/Core/API/API.Specs/TestApiFactory.cs b/src/Core/API/API.Specs/TestApiFactory.cs new file mode 100644 index 0000000..36e7820 --- /dev/null +++ b/src/Core/API/API.Specs/TestApiFactory.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc.Testing; +using Microsoft.Extensions.Configuration; + +namespace API.Specs +{ + public class TestApiFactory : WebApplicationFactory + { + protected override void ConfigureWebHost(IWebHostBuilder builder) + { + builder.UseEnvironment("Testing"); + + builder.ConfigureAppConfiguration((context, configBuilder) => + { + var connectionString = Environment.GetEnvironmentVariable("DB_CONNECTION_STRING"); + }); + } + } +} diff --git a/src/Core/Core.slnx b/src/Core/Core.slnx index c2686d1..9fe412a 100644 --- a/src/Core/Core.slnx +++ b/src/Core/Core.slnx @@ -1,6 +1,7 @@ +