Refactor test DB config to support SQL Server and fix seeding

Refactored Fake.cs to configure both in-memory and SQL Server
database contexts for testing, using the "Default" connection
string from configuration. Added detailed EF logging and SQL
executor setup. In TestBase.cs, fixed Setup to use the correct
repository instance for seeding email templates.
This commit is contained in:
2026-01-19 15:51:09 +01:00
parent 4da5848253
commit 9cfdd16970
3 changed files with 35 additions and 13 deletions

View File

@@ -32,9 +32,11 @@ public abstract class TestBase : Faker
Host = Fake.CreateHost(ConfigureServices);
await Host.AddSamples();
var repo = GetRepository<EmailTemplate>();
// Add seed email templates
foreach (var temp in SeedEmailTemplates)
await Repository.CreateAsync(temp);
await repo.CreateAsync(temp);
}
[TearDown]