From 92b556e54fa490bbe5f37058a390109c793ec40e Mon Sep 17 00:00:00 2001 From: d11n Date: Tue, 24 Jan 2023 12:12:47 +0100 Subject: [PATCH] Load debug plugins in tests (#4555) Equivalent to the loading code in Program.cs --- BTCPayServer.Tests/BTCPayServerTester.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BTCPayServer.Tests/BTCPayServerTester.cs b/BTCPayServer.Tests/BTCPayServerTester.cs index dd5928a2d..45db5eb99 100644 --- a/BTCPayServer.Tests/BTCPayServerTester.cs +++ b/BTCPayServer.Tests/BTCPayServerTester.cs @@ -23,6 +23,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting.Server.Features; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Logging; @@ -168,7 +169,11 @@ namespace BTCPayServer.Tests HttpClient = new HttpClient(); HttpClient.BaseAddress = ServerUri; Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Development"); - var conf = new DefaultConfiguration() { Logger = LoggerProvider.CreateLogger("Console") }.CreateConfiguration(new[] { "--datadir", _Directory, "--conf", confPath, "--disable-registration", DisableRegistration ? "true" : "false" }); + var confBuilder = new DefaultConfiguration() { Logger = LoggerProvider.CreateLogger("Console") }.CreateConfigurationBuilder(new[] { "--datadir", _Directory, "--conf", confPath, "--disable-registration", DisableRegistration ? "true" : "false" }); +#if DEBUG + confBuilder.AddJsonFile("appsettings.dev.json", true, false); +#endif + var conf = confBuilder.Build(); _Host = new WebHostBuilder() .UseConfiguration(conf) .UseContentRoot(FindBTCPayServerDirectory())