< Summary - MechanicsSoftware — Coverage Report

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

#LineLine coverage
 1using MechanicsSoftware.Application.Abstractions;
 2using MechanicsSoftware.Application.Exceptions;
 3using MechanicsSoftware.Domain.Entities;
 4using Microsoft.EntityFrameworkCore;
 5
 6namespace MechanicsSoftware.Application.UseCases.Vehicles.Handlers;
 7
 48public sealed class GetVehicleHandler(IAppDbContext db)
 9{
 10    public async Task<VehicleResponse> ExecuteAsync(Guid id, CancellationToken cancellationToken = default)
 411    {
 412        var vehicle = await db.Vehicles
 413            .FirstOrDefaultAsync(v => v.Id == id, cancellationToken)
 414            ?? throw new NotFoundException(nameof(Vehicle), id);
 15
 216        return VehicleResponse.From(vehicle);
 217    }
 18}