feat(email): add delivery adapters
CI and Deploy / test (pull_request) Failing after 1m37s
CI and Deploy / deploy (pull_request) Has been skipped

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:
cesnimda
2026-08-09 23:47:21 +02:00
parent 429f427f49
commit e9937accd8
11 changed files with 331 additions and 9 deletions
@@ -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]