< Summary

Information
Class: Syki.Back.Features.Cross.CreatePendingUserRegister.UserRegister
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Cross/CreatePendingUserRegister/UserRegister.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 13
Uncovered lines: 0
Coverable lines: 13
Total lines: 26
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
get_Id()100%11100%
get_Email()100%11100%
get_TrialStart()100%11100%
get_TrialEnd()100%11100%
.ctor(...)100%11100%
Finish()100%22100%

File(s)

/home/runner/work/syki/syki/Back/Features/Cross/CreatePendingUserRegister/UserRegister.cs

#LineLine coverage
 1namespace Syki.Back.Features.Cross.CreatePendingUserRegister;
 2
 3public class UserRegister
 4{
 17475    public Guid Id { get; set; }
 20256    public string Email { get; set; }
 5847    public DateOnly? TrialStart { get; set; }
 3048    public DateOnly? TrialEnd { get; set; }
 9
 117210    public UserRegister(string email)
 11    {
 117212        Id = Guid.NewGuid();
 117213        Email = email.ToLower();
 117214    }
 15
 16    public OneOf<SykiSuccess, SykiError> Finish()
 17    {
 28018        if (TrialStart != null)
 119            return new UserAlreadyRegistered();
 20
 27921        TrialStart = DateOnly.FromDateTime(DateTime.Now);
 27922        TrialEnd = DateOnly.FromDateTime(DateTime.Now.AddDays(7));
 23
 27924        return new SykiSuccess();
 25    }
 26}