feat(TestBase): seed real email templates in TestBase setup

- Added `RealEmailTemplates` property with predefined email templates.
- Populated the repository with these templates in the `Setup` method.
- Ensures tests have consistent, realistic email data available.
This commit is contained in:
2025-09-15 12:44:36 +02:00
parent d5afb2201c
commit ccc4e948f3
4 changed files with 105 additions and 7 deletions

View File

@@ -30,9 +30,8 @@ public class HistoryHandler : INotificationHandler<DocSignedNotification>
/// <returns></returns>
public async Task Handle(DocSignedNotification notification, CancellationToken cancel)
{
if(notification.Receiver is null)
if (notification.Receiver is null)
throw new InvalidOperationException($"Receiver information is missing in the notification. DocSignedNotification:\n {notification.ToJson(Format.Json.ForDiagnostics)}");
if (notification.Receiver is null)
throw new InvalidOperationException($"Receiver information is missing in the notification. DocSignedNotification:\n {notification.ToJson(Format.Json.ForDiagnostics)}");
await _sender.Send(new CreateHistoryCommand()
{

View File

@@ -99,8 +99,8 @@ public abstract class SendMailHandler<TNotification> : INotificationHandler<TNot
var placeHolders = CreatePlaceHolders(notification);
var temp = await TempRepo
.ReadOnly()
.SingleOrDefaultAsync(x => x.Name == notification.TemplateType.ToString(), cancel)
.Where(x => x.Name == notification.TemplateType.ToString())
.SingleOrDefaultAsync(cancel)
?? throw new InvalidOperationException($"Receiver information is missing in the notification." +
$"{typeof(TNotification)}:\n {notification.ToJson(Format.Json.ForDiagnostics)}");