diff --git a/EnvelopeGenerator.Infrastructure/EGDbContext.cs b/EnvelopeGenerator.Infrastructure/EGDbContext.cs index 1dfd0e2b..0c3f65b6 100644 --- a/EnvelopeGenerator.Infrastructure/EGDbContext.cs +++ b/EnvelopeGenerator.Infrastructure/EGDbContext.cs @@ -14,8 +14,15 @@ using EnvelopeGenerator.Application.Common.Configurations; namespace EnvelopeGenerator.Infrastructure; +public class EGDbContext : EGDbContextBase +{ + public EGDbContext(DbContextOptions options, IOptions triggerParamOptions, ILogger? logger = null) : base(options, triggerParamOptions, logger) + { + } +} + //TODO: Adding EmailOut instead of EmailOut.Abst is not correct for the arch. Re-design EmailPut consedering this. IMailDbContext shoud move to Abstraction layer (hint: in this case using DBSet in abst. will be problem because entity framework will have to be added. -public class EGDbContext : DbContext, IUserManagerDbContext, IMailDbContext +public abstract class EGDbContextBase : DbContext, IUserManagerDbContext, IMailDbContext { public DbSet Configs { get; set; } @@ -57,11 +64,11 @@ public class EGDbContext : DbContext, IUserManagerDbContext, IMailDbContext private readonly DbTriggerParams _triggers; - private readonly ILogger? _logger; + private readonly ILogger? _logger; public bool IsMigration { get; set; } = false; - public EGDbContext(DbContextOptions options, IOptions triggerParamOptions, ILogger? logger = null) : base(options) + public EGDbContextBase(DbContextOptions options, IOptions triggerParamOptions, ILogger? logger = null) : base(options) { _triggers = triggerParamOptions.Value; _logger = logger; diff --git a/EnvelopeGenerator.Tests.Application/DocSignedNotificationTests.cs b/EnvelopeGenerator.Tests.Application/DocSignedNotificationTests.cs index 81829a57..790aa445 100644 --- a/EnvelopeGenerator.Tests.Application/DocSignedNotificationTests.cs +++ b/EnvelopeGenerator.Tests.Application/DocSignedNotificationTests.cs @@ -1,5 +1,7 @@ using AutoMapper; using DigitalData.Core.Abstraction.Application.Repository; +using DigitalData.Core.Infrastructure; +using DigitalData.EmailProfilerDispatcher.Abstraction.Entities; using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver; using EnvelopeGenerator.Application.Common.Notifications.DocSigned; using EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers; @@ -14,6 +16,9 @@ public class DocSignedNotificationTests : TestBase protected override void ConfigureServices(IServiceCollection services) { services.AddTransient(); + + // overwrite EmailOutRepository + services.AddDbRepository(opt => opt.RegisterEntity(ctx => ctx.EMailOuts)) } public override async Task Setup() diff --git a/EnvelopeGenerator.Tests.Application/Fake.cs b/EnvelopeGenerator.Tests.Application/Fake.cs index 3f54b6c2..04c62192 100644 --- a/EnvelopeGenerator.Tests.Application/Fake.cs +++ b/EnvelopeGenerator.Tests.Application/Fake.cs @@ -139,9 +139,9 @@ public class Fake /// Represents a mock database context that inherits from . /// This context is intended for testing purposes while connecting to the production database. /// - public class EGDbContext2Prod : EGDbContext + public class EGDbContext2Prod : EGDbContextBase { - public EGDbContext2Prod(DbContextOptions options, IOptions triggerParamOptions, ILogger? logger = null) : base(options, triggerParamOptions, logger) + public EGDbContext2Prod(DbContextOptions options, IOptions triggerParamOptions, ILogger? logger = null) : base(options, triggerParamOptions, logger) { } }