From cf9f048daa21abb68197542f0537fb95eaa5244e Mon Sep 17 00:00:00 2001 From: Aaron Po Date: Thu, 29 Jan 2026 22:48:35 -0500 Subject: [PATCH] Add TestApiFactory for BDD testing setup and include API.Specs project in solution --- src/Core/API/API.Specs/TestApiFactory.cs | 20 ++++++++++++++++++++ src/Core/Core.slnx | 1 + 2 files changed, 21 insertions(+) create mode 100644 src/Core/API/API.Specs/TestApiFactory.cs 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 @@ +