< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.WebApi.Email.LoggingScopeInvitationNoticeSender
Assembly: ArturRios.Heimdall.WebApi
File(s): /home/ci/agent/workspace/heimdall-api-docs_main/app/src/Presentation/ArturRios.Heimdall.WebApi/Email/LoggingScopeInvitationNoticeSender.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 29
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 3
Fully covered methods: 3
Total methods: 3
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
SendInvitationAsync(...)100%11100%
SendAnswerAsync(...)100%11100%

File(s)

/home/ci/agent/workspace/heimdall-api-docs_main/app/src/Presentation/ArturRios.Heimdall.WebApi/Email/LoggingScopeInvitationNoticeSender.cs

#LineLine coverage
 1using ArturRios.Heimdall.Command.Services;
 2using ArturRios.Heimdall.Shared.Security;
 3
 4namespace ArturRios.Heimdall.WebApi.Email;
 5
 6/// <summary>
 7///     Fallback <see cref="IScopeInvitationNoticeSender" /> for environments without Mailgun, registered beside
 8///     <see cref="LoggingEmailChangeNoticeSender" />. Logs a reference to the address, never the address itself
 9///     or the names (NFR-22).
 10/// </summary>
 2211public class LoggingScopeInvitationNoticeSender(ILogger<LoggingScopeInvitationNoticeSender> logger)
 12    : IScopeInvitationNoticeSender
 13{
 14    public Task SendInvitationAsync(string inviteeEmail, string inviterName, string scopeName, DateTime expiresAt)
 15    {
 416        logger.LogInformation("Scope invitation notice for {EmailRef}", LogSafeEmail.Reference(inviteeEmail));
 17
 418        return Task.CompletedTask;
 19    }
 20
 21    public Task SendAnswerAsync(string inviterEmail, string inviteeName, string scopeName, bool accepted)
 22    {
 323        logger.LogInformation(
 324            "Scope invitation answer notice for {EmailRef} (accepted: {Accepted})",
 325            LogSafeEmail.Reference(inviterEmail), accepted);
 26
 327        return Task.CompletedTask;
 28    }
 29}