< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.WebApi.Email.LoggingEmailVerificationSender
Assembly: ArturRios.Heimdall.WebApi
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Presentation/ArturRios.Heimdall.WebApi/Email/LoggingEmailVerificationSender.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 24
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage
100%
Covered methods: 2
Fully covered methods: 2
Total methods: 2
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
SendAsync(...)50%22100%

File(s)

/home/runner/work/heimdall-api/heimdall-api/src/Presentation/ArturRios.Heimdall.WebApi/Email/LoggingEmailVerificationSender.cs

#LineLine coverage
 1using ArturRios.Heimdall.Shared.Security;
 2using ArturRios.Heimdall.Command.Services;
 3
 4namespace ArturRios.Heimdall.WebApi.Email;
 5
 6/// <summary>
 7///     Fallback <see cref="IEmailVerificationSender" /> for environments without Mailgun
 8///     credentials: logs the recipient and token instead of delivering a real email. Registered in
 9///     place of <see cref="MailgunEmailVerificationSender" /> when
 10///     <see cref="EmailDeliveryOptions.MailgunConfigured" /> is false — which is how the functional
 11///     suite stays off the network.
 12/// </summary>
 13313public class LoggingEmailVerificationSender(ILogger<LoggingEmailVerificationSender> logger)
 14    : IEmailVerificationSender
 15{
 16    public Task SendAsync(string email, string token, string? linkBase)
 17    {
 2518        logger.LogInformation(
 2519            "Email verification token issued for {EmailRef}: {Token} (link base: {LinkBase})",
 2520            LogSafeEmail.Reference(email), token, string.IsNullOrWhiteSpace(linkBase) ? "global" : "scope");
 21
 2522        return Task.CompletedTask;
 23    }
 24}