< Summary

Information
Class: FAU.Logica.Services.PeriodoGuard
Assembly: FAU.Logica
File(s): /home/runner/work/Sistema.Liquidacion.BE/Sistema.Liquidacion.BE/FAU.Logica/Services/PeriodoGuard.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 24
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
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%
VerificarPeriodoAbiertoAsync()100%44100%

File(s)

/home/runner/work/Sistema.Liquidacion.BE/Sistema.Liquidacion.BE/FAU.Logica/Services/PeriodoGuard.cs

#LineLine coverage
 1using FAU.DataAccess.Repositories;
 2using FAU.Entidades;
 3using FAU.Logica.Exceptions;
 4
 5namespace FAU.Logica.Services;
 6
 7public class PeriodoGuard : IPeriodoGuard
 8{
 9    private readonly IPeriodosRepository _periodosRepository;
 10
 611    public PeriodoGuard(IPeriodosRepository periodosRepository)
 12    {
 613        _periodosRepository = periodosRepository;
 614    }
 15
 16    public async Task VerificarPeriodoAbiertoAsync()
 17    {
 518        var periodo = await _periodosRepository.ObtenerEnCursoAsync();
 519        if (periodo is not null && periodo.Estado != Periodo.EstadoAbierta)
 20        {
 321            throw new PeriodoBloqueadoException(periodo.Estado);
 22        }
 223    }
 24}