using LiteCharms.Features.Shop.Notifications; using LiteCharms.Features.Shop.Notifications.Events; namespace LiteCharms.Features.Tests; public class NotificationsFeatureTests(CommonFixture fixture, ITestOutputHelper output) : IClassFixture { private readonly NotificationService notificationService = fixture.Services.GetRequiredService(); [Fact] public async Task CreateNotificationCommand_ShouldSucceed() { Shop.Notifications.Models.CreateNotification request = new() { CorrelationId = Guid.CreateVersion7().ToString(), CorrelationIdType = Shop.CorrelationIdTypes.None, Direction = Shop.NotificationDirection.Outgoing, Platform = Shop.NotificationPlatforms.Email, Priority = Shop.Priorities.Medium, Sender = "xUnit Test", SenderAddress = "khwezi@mngoma.africa", Recipient = $"{Email.Extensions.Constants.ShopEmailFromName} [Test]", RecipientAddress = Email.Extensions.Constants.ShopEmailFromAddress, Subject = "Test Message", Message = "This is an automation test", IsHtml = false, IsInternal = true, }; var createResult = await notificationService.CreateNotificationAsync(request); Assert.True(createResult.IsSuccess); foreach (var error in createResult.Errors) output.WriteLine(error.Message); } [Fact] public async Task ProcessEmailNotificationsEvent_ShouldSucceed() { var notification = ProcessEmailNotificationsEvent.Create(); await fixture.Mediator.Publish(notification); Assert.True(true); } }