< Summary

Information
Class: Syki.Front.Components.Passwords.SetupPassword
Assembly: Front
File(s): /home/runner/work/syki/syki/Front/Components/Passwords/SetupPassword.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 13
Uncovered lines: 0
Coverable lines: 13
Total lines: 26
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Password()100%11100%
get_Validation()100%11100%
.ctor()100%11100%
Validate()100%11100%
IsValid()100%11100%

File(s)

/home/runner/work/syki/syki/Front/Components/Passwords/SetupPassword.cs

#LineLine coverage
 1namespace Syki.Front.Components.Passwords;
 2
 3public class SetupPassword
 4{
 785    public string Password { get; set; }
 916    public SetupPasswordValidation Validation { get; set; } = new();
 7
 138    private readonly string _numbers = "0123456789";
 139    private readonly string _lowers = "abcdefghijklmnopqrstuvwxyz";
 1310    private readonly string _uppers = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 1311    private readonly string _nonAlphanumeric = "()~!@#$%^&*-+=|{}[]:;<>,.?/_";
 12
 13    public void Validate()
 14    {
 1315        Validation.HasNumbers = Password.IndexOfAny(_numbers.ToCharArray()) >= 0;
 1316        Validation.HasLower = Password.IndexOfAny(_lowers.ToCharArray()) >= 0;
 1317        Validation.HasUpper = Password.IndexOfAny(_uppers.ToCharArray()) >= 0;
 1318        Validation.HasLength = Password.Length >= 8;
 1319        Validation.HasNonAlphanumeric = Password.IndexOfAny(_nonAlphanumeric.ToCharArray()) >= 0;
 1320    }
 21
 22    public bool IsValid()
 23    {
 824        return Validation.IsValid();
 25    }
 26}