< Summary - Syki

Information
Class: Syki.Shared.CreateUserIn
Assembly: Shared
File(s): /home/runner/work/syki/syki/Shared/Features/Cross/CreateUser/CreateUserIn.cs
Tag: 4_16869239191
Line coverage
100%
Covered lines: 31
Uncovered lines: 0
Coverable lines: 31
Total lines: 48
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_InstitutionId()100%11100%
get_Name()100%11100%
get_Email()100%11100%
get_Password()100%11100%
get_Role()100%11100%
get_PhoneNumber()100%11100%
NewAcademic(...)100%11100%
NewTeacher(...)100%11100%
NewStudent(...)100%11100%

File(s)

/home/runner/work/syki/syki/Shared/Features/Cross/CreateUser/CreateUserIn.cs

#LineLine coverage
 1namespace Syki.Shared;
 2
 3public class CreateUserIn
 4{
 30845    public Guid InstitutionId { get; set; }
 20566    public string Name { get; set; }
 41127    public string Email { get; set; }
 20568    public string Password { get; set; }
 20409    public UserRole Role { get; set; }
 120010    public string? PhoneNumber { get; set; }
 11
 12    public static CreateUserIn NewAcademic(Guid institutionId, string email, string password)
 13    {
 58814        return new()
 58815        {
 58816            Name = email,
 58817            Email = email,
 58818            Password = password,
 58819            Role = UserRole.Academic,
 58820            InstitutionId = institutionId,
 58821        };
 22    }
 23
 24    public static CreateUserIn NewTeacher(Guid institutionId, string name, string email)
 25    {
 26426        return new()
 26427        {
 26428            Name = name,
 26429            Email = email,
 26430            Role = UserRole.Teacher,
 26431            InstitutionId = institutionId,
 26432            Password = $"Teacher@{Guid.CreateVersion7()}",
 26433        };
 34    }
 35
 36    public static CreateUserIn NewStudent(Guid institutionId, string name, string email, string? phoneNumber)
 37    {
 17838        return new()
 17839        {
 17840            Name = name,
 17841            Email = email,
 17842            Role = UserRole.Student,
 17843            PhoneNumber = phoneNumber,
 17844            InstitutionId = institutionId,
 17845            Password = $"Student@{Guid.CreateVersion7()}",
 17846        };
 47    }
 48}