feat: consume transactional email notifications
Add contract validation, SMTP delivery results, terminal failure context, neutral development seeding, and local Docker setup. Ref: IT-1033
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
namespace HrynCo.NotificationService.Services.Tests.EmailProcessing;
|
||||
|
||||
using HrynCo.NotificationService.DAL.Abstract.Repositories;
|
||||
using HrynCo.NotificationService.Worker.Services.EmailProcessing;
|
||||
using NSubstitute;
|
||||
|
||||
public sealed class EmailTemplateServiceTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task GetAsync_WhenRequestedLanguageDoesNotExist_DoesNotSilentlyFallback()
|
||||
{
|
||||
IEmailTemplateRepository repository = Substitute.For<IEmailTemplateRepository>();
|
||||
var service = new EmailTemplateService(repository);
|
||||
|
||||
InvalidOperationException exception = await Assert.ThrowsAsync<InvalidOperationException>(
|
||||
() => service.GetAsync("StoreMate-Prod", "EmailVerification", "UK", CancellationToken.None));
|
||||
|
||||
Assert.Contains("language='uk'", exception.Message);
|
||||
await repository.Received(1).GetAsync(
|
||||
"StoreMate-Prod",
|
||||
"EmailVerification",
|
||||
"uk",
|
||||
CancellationToken.None);
|
||||
await repository.DidNotReceive().GetAsync(
|
||||
"StoreMate-Prod",
|
||||
"EmailVerification",
|
||||
"en",
|
||||
Arg.Any<CancellationToken>());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user