< Summary - Estud

Information
Class: Estud.Back.Features.Notifications.CreateNotification.CreateNotificationController
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Notifications/CreateNotification/CreateNotificationController.cs
Tag: 114_29044117136
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 27
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%
Create()100%11100%

File(s)

/home/runner/work/syki/syki/Back/Features/Notifications/CreateNotification/CreateNotificationController.cs

#LineLine coverage
 1namespace Estud.Back.Features.Notifications.CreateNotification;
 2
 3[ApiController, Authorize(Policies.CreateNotification)]
 224public class CreateNotificationController(CreateNotificationService service) : ControllerBase
 5{
 6    /// <summary>
 7    /// Criar notificação
 8    /// </summary>
 9    /// <remarks>
 10    /// Cria uma nova notificação.
 11    /// </remarks>
 12    [HttpPost("notifications")]
 13    [SwaggerResponseExample(200, typeof(ResponseExamples))]
 14    [SwaggerResponseExample(400, typeof(ErrorsExamples))]
 15    public async Task<IActionResult> Create([FromBody] CreateNotificationIn data)
 16    {
 2217        var result = await service.Create(data);
 2218        return result.Match<IActionResult>(Ok, BadRequest);
 2219    }
 20}
 21
 22internal class RequestExamples : ExamplesProvider<CreateNotificationIn>;
 23internal class ResponseExamples : ExamplesProvider<NotificationOut>;
 24internal class ErrorsExamples : ErrorExamplesProvider<
 25    InvalidNotificationTitle,
 26    InvalidNotificationDescription
 27>;