< Summary - Syki

Information
Class: Syki.Back.Features.Students.EnrollStudentInCourseOffering.EnrollStudentInCourseOfferingController
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Students/EnrollStudentInCourseOffering/EnrollStudentInCourseOfferingController.cs
Tag: 97_27801654829
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
Total lines: 24
Line coverage: 0%
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%210%
Enroll()100%210%

File(s)

/home/runner/work/syki/syki/Back/Features/Students/EnrollStudentInCourseOffering/EnrollStudentInCourseOfferingController.cs

#LineLine coverage
 1namespace Syki.Back.Features.Students.EnrollStudentInCourseOffering;
 2
 3[ApiController, Authorize(Policies.EnrollStudentInCourseOffering)]
 04public class EnrollStudentInCourseOfferingController(EnrollStudentInCourseOfferingService service) : ControllerBase
 5{
 6    /// <summary>Matricular aluno em oferta de curso</summary>
 7    /// <remarks>Vincula um aluno a uma oferta de curso, criando uma matrícula.</remarks>
 8    [HttpPost("students/{studentId:int}/course-offerings")]
 9    [SwaggerResponseExample(200, typeof(ResponseExamples))]
 10    [SwaggerResponseExample(400, typeof(ErrorsExamples))]
 11    public async Task<IActionResult> Enroll([FromRoute] int studentId, [FromBody] EnrollStudentInCourseOfferingIn data)
 12    {
 013        var result = await service.Enroll(studentId, data);
 014        return result.Match<IActionResult>(Ok, BadRequest);
 015    }
 16}
 17
 18internal class RequestExamples : ExamplesProvider<EnrollStudentInCourseOfferingIn>;
 19internal class ResponseExamples : ExamplesProvider<EnrollStudentInCourseOfferingOut>;
 20internal class ErrorsExamples : ErrorExamplesProvider<
 21    StudentNotFound,
 22    CourseOfferingNotFound,
 23    StudentAlreadyEnrolledInCourseOffering
 24>;