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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user