< Summary

Information
Class: Syki.Back.Features.Academic.CreateStudent.SykiStudent
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Academic/CreateStudent/SykiStudent.cs
Tag: 22_11348620282
Line coverage
97%
Covered lines: 43
Uncovered lines: 1
Coverable lines: 44
Total lines: 68
Line coverage: 97.7%
Branch coverage
91%
Covered branches: 11
Total branches: 12
Branch coverage: 91.6%
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_InstitutionId()100%11100%
get_User()100%11100%
get_CourseOfferingId()100%11100%
get_CourseOffering()100%11100%
get_Name()100%11100%
get_EnrollmentCode()100%11100%
get_Status()100%11100%
get_YieldCoefficient()100%210%
.ctor(...)100%11100%
ToOut()91.66%1212100%
ToTeacherClassStudentOut()100%11100%
ToAcademicClassStudentOut()100%11100%

File(s)

/home/runner/work/syki/syki/Back/Features/Academic/CreateStudent/SykiStudent.cs

#LineLine coverage
 1using Syki.Back.Features.Cross.CreateUser;
 2using Syki.Back.Features.Academic.CreateCourseOffering;
 3
 4namespace Syki.Back.Features.Academic.CreateStudent;
 5
 6/// <summary>
 7/// Representa um Aluno.
 8/// </summary>
 9public class SykiStudent
 10{
 76211    public Guid Id { get; }
 112    public Guid InstitutionId { get; }
 16213    public SykiUser User { get; }
 8414    public Guid CourseOfferingId { get; }
 8215    public CourseOffering CourseOffering { get; set; }
 14316    public string Name { get; }
 28517    public string EnrollmentCode { get; }
 318    public StudentStatus Status { get; }
 019    public decimal YieldCoefficient { get; set; }
 20
 43321    public SykiStudent(
 43322        Guid id,
 43323        Guid institutionId,
 43324        string name,
 43325        Guid courseOfferingId
 43326    ) {
 43327        Id = id;
 43328        InstitutionId = institutionId;
 43329        CourseOfferingId = courseOfferingId;
 43330        Name = name;
 43331        EnrollmentCode = $"{DateTime.Now.Year}{Guid.NewGuid().ToString()[..8].ToUpper()}";
 43332        Status = StudentStatus.Enrolled;
 43333    }
 34
 35    public StudentOut ToOut()
 36    {
 8137        return new()
 8138        {
 8139            Id = Id,
 8140            Name = Name,
 8141            Email = User?.Email ?? "-",
 8142            PhoneNumber = User?.PhoneNumber,
 8143            EnrollmentCode = EnrollmentCode,
 8144            CourseOfferingId = CourseOfferingId,
 8145            CourseOffering = CourseOffering?.Course?.Name ?? "-",
 8146        };
 47    }
 48
 49    public TeacherClassStudentOut ToTeacherClassStudentOut()
 50    {
 2951        return new()
 2952        {
 2953            Id = Id,
 2954            Name = Name,
 2955            ExamGrades = [],
 2956        };
 57    }
 58
 59    public AcademicClassStudentOut ToAcademicClassStudentOut()
 60    {
 161        return new()
 162        {
 163            Id = Id,
 164            Name = Name,
 165            ExamGrades = [],
 166        };
 67    }
 68}