< Summary

Information
Class: Syki.Back.Features.Academic.CreateCourseCurriculum.CourseCurriculum
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Academic/CreateCourseCurriculum/CourseCurriculum.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 33
Uncovered lines: 0
Coverable lines: 33
Total lines: 54
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
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_InstitutionId()100%11100%
get_CourseId()100%11100%
get_Course()100%11100%
get_Name()100%11100%
get_Disciplines()100%11100%
get_Links()100%11100%
.ctor(...)100%11100%
ToOut()100%22100%

File(s)

/home/runner/work/syki/syki/Back/Features/Academic/CreateCourseCurriculum/CourseCurriculum.cs

#LineLine coverage
 1using Syki.Back.Features.Academic.CreateCourse;
 2using Syki.Back.Features.Academic.CreateDiscipline;
 3
 4namespace Syki.Back.Features.Academic.CreateCourseCurriculum;
 5
 6/// <summary>
 7/// Grade Curricular de um Curso.
 8/// Um mesmo Curso pode possuir diversas Grades diferentes.
 9/// </summary>
 10public class CourseCurriculum
 11{
 114712    public Guid Id { get; set; }
 69813    public Guid InstitutionId { get; set; }
 92514    public Guid CourseId { get; set; }
 22815    public Course Course { get; set; }
 113716    public string Name { get; set; }
 92817    public List<Discipline> Disciplines { get; set; }
 272818    public List<CourseCurriculumDiscipline> Links { get; set; }
 19
 69820    public CourseCurriculum(
 69821        Guid institutionId,
 69822        Guid courseId,
 69823        string name
 69824    ) {
 69825        Id = Guid.NewGuid();
 69826        InstitutionId = institutionId;
 69827        CourseId = courseId;
 69828        Name = name;
 69829        Disciplines = [];
 69830        Links = [];
 69831    }
 32
 33    public CourseCurriculumOut ToOut()
 34    {
 22635        var result = new CourseCurriculumOut
 22636        {
 22637            Id = Id,
 22638            CourseId = CourseId,
 22639            CourseName = Course.Name,
 22640            Name = Name,
 176341            Disciplines = Disciplines.ConvertAll(d => d.ToOut()),
 22642        };
 43
 397844        foreach (var link in Links)
 45        {
 1136446            var discipline = result.Disciplines.First(x => x.Id == link.DisciplineId);
 176347            discipline.Period = link.Period;
 176348            discipline.Credits = link.Credits;
 176349            discipline.Workload = link.Workload;
 50        }
 51
 22652        return result;
 53    }
 54}