< Summary

Information
Class: Syki.Back.Features.Student.CreateStudentEnrollment.ExamGrade
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Student/CreateStudentEnrollment/ExamGrade.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 28
Uncovered lines: 0
Coverable lines: 28
Total lines: 47
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
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_ClassId()100%11100%
get_StudentId()100%11100%
get_ExamType()100%11100%
get_Note()100%11100%
.ctor(...)100%11100%
AddNote(...)100%44100%
ToOut()100%11100%

File(s)

/home/runner/work/syki/syki/Back/Features/Student/CreateStudentEnrollment/ExamGrade.cs

#LineLine coverage
 1namespace Syki.Back.Features.Student.CreateStudentEnrollment;
 2
 3/// <summary>
 4/// Representa uma Prova.
 5/// </summary>
 6public class ExamGrade
 7{
 8588    public Guid Id { get; set; }
 11569    public Guid ClassId { get; set; }
 106510    public Guid StudentId { get; set; }
 97211    public ExamType ExamType { get; set; }
 111712    public decimal Note { get; set; }
 13
 73514    public ExamGrade(
 73515        Guid classId,
 73516        Guid studentId,
 73517        ExamType examType,
 73518        decimal note
 73519    ) {
 73520        Id = Guid.NewGuid();
 73521        ClassId = classId;
 73522        StudentId = studentId;
 73523        ExamType = examType;
 73524        Note = note;
 73525    }
 26
 27    public OneOf<SykiSuccess, SykiError> AddNote(decimal note)
 28    {
 4429        if (note < 0 || note > 10) return new InvalidExamGradeNote();
 30
 4031        Note = note;
 32
 4033        return new SykiSuccess();
 34    }
 35
 36    public ExamGradeOut ToOut()
 37    {
 12338        return new()
 12339        {
 12340            Id = Id,
 12341            ClassId = ClassId,
 12342            StudentId = StudentId,
 12343            ExamType = ExamType,
 12344            Note = Note,
 12345        };
 46    }
 47}