< Summary

Information
Class: Anichron.API.Services.PasswordSettingCheck
Assembly: Anichron.API
File(s): /home/runner/work/anichron/anichron/src/Anichron.API/Services/PasswordSettingCheck.cs
Tag: 19_45211875487
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 15
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
EnsureMeetsPolicyAsync()100%22100%

File(s)

/home/runner/work/anichron/anichron/src/Anichron.API/Services/PasswordSettingCheck.cs

#LineLine coverage
 1namespace Anichron.API.Services;
 2
 3internal static class PasswordSettingCheck
 4{
 5    internal static async Task EnsureMeetsPolicyAsync(
 6        this IRegistrationValidator validator, string setting, string value, CancellationToken ct)
 207    {
 208        var rejected = await validator.ValidatePasswordAsync(value, ct);
 209        if (rejected is not null)
 610        {
 611            var broken = rejected.Match(() => "is too short", () => "is too long", () => "is known to be breached");
 612            throw new InvalidOperationException($"{setting} {broken}.");
 13        }
 1414    }
 15}

Methods/Properties

EnsureMeetsPolicyAsync()