< Summary

Information
Class: Syki.Back.Features.Teacher.GetTeacherAgenda.GetTeacherAgendaService
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Teacher/GetTeacherAgenda/GetTeacherAgendaService.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 16
Uncovered lines: 0
Coverable lines: 16
Total lines: 24
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/Teacher/GetTeacherAgenda/GetTeacherAgendaService.cs

#LineLine coverage
 1namespace Syki.Back.Features.Teacher.GetTeacherAgenda;
 2
 13public class GetTeacherAgendaService(SykiDbContext ctx) : ITeacherService
 4{
 5    public async Task<List<AgendaDayOut>> Get(Guid institution, Guid userId)
 6    {
 17        var classes = await ctx.Classes.AsNoTracking()
 18            .Include(t => t.Discipline)
 19            .Include(t => t.Schedules)
 110            .Where(t => t.InstitutionId == institution && t.TeacherId == userId && t.Status == ClassStatus.Started)
 111            .ToListAsync();
 12
 113        var response = classes.ConvertAll(t =>
 114        {
 615            return new EnrollmentClassOut
 616            {
 617                Discipline = t.Discipline.Name,
 618                Schedules = t.Schedules.ConvertAll(h => h.ToOut()),
 619            };
 120        });
 21
 122        return response.ToAgendas();
 123    }
 24}