< Summary

Information
Class: Syki.Back.Features.Academic.UpdateCampus.UpdateCampusService
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Academic/UpdateCampus/UpdateCampusService.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 17
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
Update()100%22100%

File(s)

/home/runner/work/syki/syki/Back/Features/Academic/UpdateCampus/UpdateCampusService.cs

#LineLine coverage
 1namespace Syki.Back.Features.Academic.UpdateCampus;
 2
 43public class UpdateCampusService(SykiDbContext ctx) : IAcademicService
 4{
 5  public async Task<OneOf<CampusOut, SykiError>> Update(Guid institutionId, UpdateCampusIn data)
 6  {
 47    var campus = await ctx.Campi
 48      .FirstOrDefaultAsync(x => x.InstitutionId == institutionId && x.Id == data.Id);
 9
 610    if (campus == null) return new CampusNotFound();
 11
 212    campus.Update(data.Name, data.City);
 213    await ctx.SaveChangesAsync();
 14
 215    return campus.ToOut();
 416  }
 17}