feat(email): add delivery adapters
Gmail and Graph request explicit send consent and classify provider rejection separately from uncertain transport failure. IMAP remains read-only; no send API is exposed.
This commit is contained in:
@@ -12,7 +12,7 @@ public sealed class EmailControllerTests
|
||||
[Fact]
|
||||
public async Task Provider_status_is_owner_scoped_and_does_not_claim_send_support()
|
||||
{
|
||||
var gmail = new FakeProvider("gmail", new EmailConnectionInfo("gmail", "owner@gmail.test"));
|
||||
var gmail = new FakeProvider("gmail", new EmailConnectionInfo("gmail", "owner@gmail.test", CanSend: true));
|
||||
var outlook = new FakeProvider("microsoft", null);
|
||||
var controller = CreateController(gmail, outlook);
|
||||
|
||||
@@ -27,7 +27,7 @@ public sealed class EmailControllerTests
|
||||
Assert.Equal("Gmail", status.DisplayName);
|
||||
Assert.True(status.Connected);
|
||||
Assert.True(status.CanRead);
|
||||
Assert.False(status.CanSend);
|
||||
Assert.True(status.CanSend);
|
||||
},
|
||||
status =>
|
||||
{
|
||||
@@ -113,5 +113,8 @@ public sealed class EmailControllerTests
|
||||
Array.Empty<string>(),
|
||||
Array.Empty<EmailAttachmentRef>()));
|
||||
}
|
||||
|
||||
public Task<EmailDeliveryResult> SendAsync(string ownerUserId, EmailDeliveryRequest request, CancellationToken cancellationToken) =>
|
||||
Task.FromResult(new EmailDeliveryResult("message-1", "thread-1"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user