< Summary

Information
Class: Despesas.Application.Abstractions.BusinessBase<T1, T2>
Assembly: Despesas.Application
File(s): /src/Despesas.Application/Abstractions/BusinessBase.cs
Line coverage
66%
Covered lines: 8
Uncovered lines: 4
Coverable lines: 12
Total lines: 34
Line coverage: 66.6%
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
get_UnitOfWork()100%11100%
get_Mapper()100%11100%
get_Repository()100%210%
.ctor(...)100%11100%
FindById(...)100%210%
FindById(...)100%210%

File(s)

/src/Despesas.Application/Abstractions/BusinessBase.cs

#LineLine coverage
 1using AutoMapper;
 2using Despesas.Repository.UnitOfWork.Abstractions;
 3using Repository.Persistency.Generic;
 4
 5namespace Despesas.Application.Abstractions;
 6public abstract class BusinessBase<Dto, Entity> : IBusinessBase<Dto, Entity> where Dto : class where Entity : class, new
 7{
 578    protected IUnitOfWork<Entity>? UnitOfWork { get; }
 469    protected IMapper Mapper { get; set; }
 10
 011    protected IRepositorio<Entity> Repository { get; }
 12
 2613    protected BusinessBase(IMapper mapper, IRepositorio<Entity> repository, IUnitOfWork<Entity> unitOfWork = null)
 2614    {
 2615        Repository = repository;
 2616        Mapper = mapper;
 2617        UnitOfWork = unitOfWork;
 2618    }
 19
 20    public abstract Task<Dto> Create(Dto dto);
 21
 22    public virtual Task<Dto> FindById(Guid id)
 023    {
 024        throw new NotImplementedException("Este método não foi implementado.");
 25    }
 26
 027    public virtual Task<Dto> FindById(Guid id, Guid idUsuario) { return null; }
 28
 29    public abstract Task<List<Dto>> FindAll(Guid idUsuario);
 30
 31    public abstract Task<Dto> Update(Dto dto);
 32
 33    public abstract Task<bool> Delete(Dto dto);
 34}