< Summary - Syki

Information
Class: Syki.Back.Features.Courses.GetCourses.GetCoursesService
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Courses/GetCourses/GetCoursesService.cs
Tag: 56_26538939494
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 20
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/Courses/GetCourses/GetCoursesService.cs

#LineLine coverage
 1namespace Syki.Back.Features.Courses.GetCourses;
 2
 23public class GetCoursesService(SykiDbContext ctx) : ISykiService
 4{
 5    public async Task<GetCoursesOut> Get()
 6    {
 27        var institutionId = ctx.RequestUser.InstitutionId;
 8
 29        var courses = await ctx.Courses.AsNoTracking()
 210            .Where(c => c.InstitutionId == institutionId)
 211            .OrderBy(c => c.Name)
 212            .ToListAsync();
 13
 214        return new GetCoursesOut
 215        {
 216            Total = courses.Count,
 417            Items = courses.ConvertAll(c => c.ToGetCoursesItemOut())
 218        };
 219    }
 20}