< Summary - Syki

Information
Class: Syki.Back.Features.Student.GetStudentAgenda.GetStudentAgendaService
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Student/GetStudentAgenda/GetStudentAgendaService.cs
Tag: 4_16869239191
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
 23public class GetStudentAgendaService(SykiDbContext ctx) : IStudentService
 4{
 5    public async Task<List<AgendaDayOut>> Get(Guid institution, Guid userId)
 6    {
 27        var ids = await ctx.ClassesStudents.AsNoTracking()
 28            .Where(x => x.SykiStudentId == userId && x.StudentDisciplineStatus == StudentDisciplineStatus.Matriculado)
 29            .Select(x => x.ClassId)
 210            .ToListAsync();
 11
 212        var classes = await ctx.Classes.AsNoTracking()
 213            .Include(t => t.Discipline)
 214            .Include(t => t.Schedules)
 215            .Where(t => t.InstitutionId == institution && ids.Contains(t.Id))
 216            .ToListAsync();
 17
 218        var response = classes.ConvertAll(t =>
 219        {
 420            return new EnrollmentClassOut
 421            {
 422                Discipline = t.Discipline.Name,
 423                Schedules = t.Schedules.ConvertAll(h => h.ToOut()),
 424            };
 225        });
 26
 227        return response.ToAgendas();
 228    }
 29}