< Summary - Syki

Information
Class: Syki.Back.Shared.CreateUserIn
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Shared/Features/Cross/CreateUser/CreateUserIn.cs
Tag: 56_26538939494
Line coverage
0%
Covered lines: 0
Uncovered lines: 39
Coverable lines: 39
Total lines: 60
Line coverage: 0%
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%210%
get_Name()100%210%
get_Email()100%210%
get_Password()100%210%
get_Role()100%210%
get_PhoneNumber()100%210%
New(...)100%210%
NewAcademic(...)100%210%
NewTeacher(...)100%210%
NewStudent(...)100%210%

File(s)

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

#LineLine coverage
 1namespace Syki.Back.Shared;
 2
 3public class CreateUserIn
 4{
 05    public Guid InstitutionId { get; set; }
 06    public string Name { get; set; }
 07    public string Email { get; set; }
 08    public string Password { get; set; }
 09    public UserRole Role { get; set; }
 010    public string? PhoneNumber { get; set; }
 11
 12    public static CreateUserIn New(Guid institutionId, string email, string password)
 13    {
 014        return new()
 015        {
 016            Name = email,
 017            Email = email,
 018            Password = password,
 019            Role = UserRole.Academic,
 020            InstitutionId = institutionId,
 021        };
 22    }
 23
 24    public static CreateUserIn NewAcademic(Guid institutionId, string email, string password)
 25    {
 026        return new()
 027        {
 028            Name = email,
 029            Email = email,
 030            Password = password,
 031            Role = UserRole.Academic,
 032            InstitutionId = institutionId,
 033        };
 34    }
 35
 36    public static CreateUserIn NewTeacher(Guid institutionId, string name, string email)
 37    {
 038        return new()
 039        {
 040            Name = name,
 041            Email = email,
 042            Role = UserRole.Teacher,
 043            InstitutionId = institutionId,
 044            Password = $"Teacher@{Guid.CreateVersion7()}",
 045        };
 46    }
 47
 48    public static CreateUserIn NewStudent(Guid institutionId, string name, string email, string? phoneNumber)
 49    {
 050        return new()
 051        {
 052            Name = name,
 053            Email = email,
 054            Role = UserRole.Student,
 055            PhoneNumber = phoneNumber,
 056            InstitutionId = institutionId,
 057            Password = $"Student@{Guid.CreateVersion7()}",
 058        };
 59    }
 60}