< Summary

Information
Class: Syki.Back.Features.Student.GetStudentAgenda.GetStudentAgendaService
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Student/GetStudentAgenda/GetStudentAgendaService.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 20
Uncovered lines: 0
Coverable lines: 20
Total lines: 29
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
.ctor(...)100%11100%
Get()100%11100%

File(s)

/home/runner/work/syki/syki/Back/Features/Student/GetStudentAgenda/GetStudentAgendaService.cs

#LineLine coverage
 1namespace Syki.Back.Features.Student.GetStudentAgenda;
 2
 13public class GetStudentAgendaService(SykiDbContext ctx) : IStudentService
 4{
 5    public async Task<List<AgendaDayOut>> Get(Guid institution, Guid userId)
 6    {
 17        var ids = await ctx.ClassesStudents.AsNoTracking()
 18            .Where(x => x.SykiStudentId == userId && x.StudentDisciplineStatus == StudentDisciplineStatus.Matriculado)
 19            .Select(x => x.ClassId)
 110            .ToListAsync();
 11
 112        var classes = await ctx.Classes.AsNoTracking()
 113            .Include(t => t.Discipline)
 114            .Include(t => t.Schedules)
 115            .Where(t => t.InstitutionId == institution && ids.Contains(t.Id))
 116            .ToListAsync();
 17
 118        var response = classes.ConvertAll(t =>
 119        {
 220            return new EnrollmentClassOut
 221            {
 222                Discipline = t.Discipline.Name,
 223                Schedules = t.Schedules.ConvertAll(h => h.ToOut()),
 224            };
 125        });
 26
 127        return response.ToAgendas();
 128    }
 29}