< Summary

Information
Class: Syki.Back.Features.Teacher.GetTeacherClass.GetTeacherClassService
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Teacher/GetTeacherClass/GetTeacherClassService.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 20
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
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()50%22100%

File(s)

/home/runner/work/syki/syki/Back/Features/Teacher/GetTeacherClass/GetTeacherClassService.cs

#LineLine coverage
 1namespace Syki.Back.Features.Teacher.GetTeacherClass;
 2
 293public class GetTeacherClassService(SykiDbContext ctx) : ITeacherService
 4{
 5    public async Task<OneOf<TeacherClassOut, SykiError>> Get(Guid institutionId, Guid userId, Guid id)
 6    {
 297        var @class = await ctx.Classes.AsNoTracking()
 298            .Include(t => t.Discipline)
 299            .Include(t => t.Students)
 2910            .Include(t => t.ExamGrades)
 2911            .Include(t => t.Lessons)
 2912                .ThenInclude(l => l.Attendances)
 2913            .Where(t => t.InstitutionId == institutionId && t.TeacherId == userId && t.Id == id)
 2914            .FirstOrDefaultAsync();
 15
 2916        if (@class == null) return new ClassNotFound();
 17
 2918        return @class.ToTeacherClassOut();
 2919    }
 20}