Refactor EmailSender to use new Email abstraction
Introduced a new `Email` record to simplify the representation of outgoing email messages. Updated the `EmailSender.Send` method to accept `Email` instead of `OutgoingEmailEvent`, with a `ToEvent()` method handling the conversion internally. Refactored test cases to use the `Email` record, removing redundant properties (`Id` and `QueuedAt`) that are now auto-generated. Updated XML documentation to reflect these changes. Adjusted namespaces and added necessary `using` directives for proper referencing. These changes improve code readability, maintainability, and centralize the mapping logic for outgoing email events.
This commit is contained in:
@@ -55,14 +55,12 @@ public sealed class EmailSenderUrlOverloadTests
|
||||
[Fact]
|
||||
public void Send_AfterUrlOverloadConnection_DoesNotThrow()
|
||||
{
|
||||
var email = new OutgoingEmailEvent
|
||||
var email = new Email
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Recipient = "url-overload-test@example.com",
|
||||
Subject = "URL Overload Integration Test",
|
||||
Body = "<p>Sent after URL-based connection.</p>",
|
||||
IsHtml = true,
|
||||
QueuedAt = DateTime.Now
|
||||
IsHtml = true
|
||||
};
|
||||
|
||||
// Connection was established via Action<> overload in the fixture;
|
||||
|
||||
Reference in New Issue
Block a user