< Summary - MechanicsSoftware — Coverage Report

Information
Class: MechanicsSoftware.Application.UseCases.Services.Handlers.GetServiceHandler
Assembly: MechanicsSoftware.Application
File(s): /home/runner/work/mechanics-software/mechanics-software/src/MechanicsSoftware.Application/UseCases/Services/Handlers/GetServiceHandler.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 16
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%
ExecuteAsync()100%22100%

File(s)

/home/runner/work/mechanics-software/mechanics-software/src/MechanicsSoftware.Application/UseCases/Services/Handlers/GetServiceHandler.cs

#LineLine coverage
 1using MechanicsSoftware.Application.Abstractions;
 2using MechanicsSoftware.Application.Exceptions;
 3using MechanicsSoftware.Domain.Entities;
 4
 5namespace MechanicsSoftware.Application.UseCases.Services.Handlers;
 6
 47public sealed class GetServiceHandler(IAppDbContext db)
 8{
 9    public async Task<ServiceResponse> ExecuteAsync(Guid id, CancellationToken cancellationToken = default)
 410    {
 411        var service = await db.Services.FindAsync([id], cancellationToken)
 412            ?? throw new NotFoundException(nameof(Service), id);
 13
 214        return ServiceResponse.From(service);
 215    }
 16}