< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.WebApi.Email.MailgunTwoFactorEmailSender
Assembly: ArturRios.Heimdall.WebApi
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Presentation/ArturRios.Heimdall.WebApi/Email/MailgunTwoFactorEmailSender.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 9
Coverable lines: 9
Total lines: 30
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
0%
Covered methods: 0
Fully covered methods: 0
Total methods: 3
Method coverage: 0%
Full method coverage: 0%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
get_Purpose()100%210%
SendAsync(...)100%210%

File(s)

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

#LineLine coverage
 1using ArturRios.Heimdall.Command.Services;
 2using ArturRios.Messaging.Email;
 3
 4namespace ArturRios.Heimdall.WebApi.Email;
 5
 6/// <summary>
 7///     Delivers UC-36's two-factor email code as a real email through Mailgun (FR-2F-03). Registered
 8///     in place of <see cref="LoggingTwoFactorEmailSender" /> whenever Mailgun is configured.
 9/// </summary>
 10public class MailgunTwoFactorEmailSender(
 11    IEmailService emailService,
 12    ILogger<MailgunTwoFactorEmailSender> logger)
 013    : MailgunSender(emailService, logger), ITwoFactorEmailSender
 14{
 15    private const string Subject = "Your two-factor authentication code";
 16
 017    protected override string Purpose => "two-factor authentication code";
 18
 19    public Task SendAsync(string email, string code)
 20    {
 021        var body = $"""
 022                    Your two-factor authentication code is: {code}
 023
 024                    This code expires in 10 minutes. If you didn't request this, you can ignore this
 025                    email — nothing has changed.
 026                    """;
 27
 028        return DeliverAsync(email, Subject, body);
 29    }
 30}