< Summary

Information
Class: Syki.Shared.CreateUserIn
Assembly: Shared
File(s): /home/runner/work/syki/syki/Shared/Features/Cross/CreateUser/CreateUserIn.cs
Tag: 22_11348620282
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{
 14415    public Guid InstitutionId { get; set; }
 9506    public string Name { get; set; }
 19007    public string Email { get; set; }
 9508    public string Password { get; set; }
 9429    public UserRole Role { get; set; }
 55110    public string? PhoneNumber { get; set; }
 11
 12    public static CreateUserIn NewAcademic(Guid institutionId, string email, string password)
 13    {
 27914        return new()
 27915        {
 27916            Name = email,
 27917            Email = email,
 27918            Password = password,
 27919            Role = UserRole.Academic,
 27920            InstitutionId = institutionId,
 27921        };
 22    }
 23
 24    public static CreateUserIn NewTeacher(Guid institutionId, string name, string email)
 25    {
 11826        return new()
 11827        {
 11828            Name = name,
 11829            Email = email,
 11830            Role = UserRole.Teacher,
 11831            InstitutionId = institutionId,
 11832            Password = $"Teacher@{Guid.NewGuid().ToString().OnlyNumbers()}",
 11833        };
 34    }
 35
 36    public static CreateUserIn NewStudent(Guid institutionId, string name, string email, string? phoneNumber)
 37    {
 9538        return new()
 9539        {
 9540            Name = name,
 9541            Email = email,
 9542            Role = UserRole.Student,
 9543            PhoneNumber = phoneNumber,
 9544            InstitutionId = institutionId,
 9545            Password = $"Student@{Guid.NewGuid().ToString().OnlyNumbers()}",
 9546        };
 47    }
 48}