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:
@@ -27,6 +27,19 @@ public sealed class MicrosoftGraphProviderTests
|
||||
Assert.NotNull(connection);
|
||||
Assert.Equal("microsoft", connection!.ProviderKey);
|
||||
Assert.Equal("user@outlook.test", connection.Address);
|
||||
Assert.False(connection.CanSend);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetConnectionAsync_reports_send_only_after_mail_send_consent()
|
||||
{
|
||||
var graph = new Mock<IMicrosoftGraphOAuthService>();
|
||||
graph.Setup(service => service.GetConnectionAsync("user-1", It.IsAny<CancellationToken>()))
|
||||
.ReturnsAsync(new JobTrackerApi.Models.MicrosoftGraphConnection { OwnerUserId = "user-1", MailAddress = "user@outlook.test", Scope = "Mail.Read Mail.Send" });
|
||||
|
||||
var connection = await new MicrosoftGraphProvider(graph.Object).GetConnectionAsync("user-1", default);
|
||||
|
||||
Assert.True(connection!.CanSend);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user