< Summary

Line coverage
85%
Covered lines: 24
Uncovered lines: 4
Coverable lines: 28
Total lines: 39
Line coverage: 85.7%
Branch coverage
75%
Covered branches: 3
Total branches: 4
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_IdCuenta()100%210%
get_NumeroCuenta()100%11100%
get_Propietario()100%11100%
get_IdPropietario()100%11100%
get_Tasa()100%11100%
get_Saldo()100%11100%
get_FechaApertura()100%210%
get_Estado()100%210%
Aperturar(...)100%11100%
Depositar(...)50%2280%
Retirar(...)100%22100%

File(s)

C:\Users\Administrator\Desktop\Calidad y Prueba de Software\Uniidad II\lab08\lab-2025-i-si784-u2-09-cs-srg-cp\Bank\Bank.Domain\CuentaAhorro.cs

#LineLine coverage
 1namespace Bank.Domain
 2{
 3    public class CuentaAhorro
 4    {
 5        public const string ERROR_MONTO_MENOR_IGUAL_A_CERO = "El monto no puede ser menor o igual a 0";
 06        public int IdCuenta { get; private set; }
 37        public string NumeroCuenta { get; private set; }
 38        public virtual Cliente Propietario { get; private set; }
 39        public int IdPropietario { get; private set; }
 310        public decimal Tasa { get; private set; }
 1311        public decimal Saldo { get; private set; }
 012        public DateTime FechaApertura { get; private set; }
 013        public bool Estado { get; private set; }
 14
 15        public static CuentaAhorro Aperturar(string _numeroCuenta, Cliente _propietario, decimal _tasa)
 316        {
 317            return new CuentaAhorro()
 318            {
 319                NumeroCuenta = _numeroCuenta,
 320                Propietario = _propietario,
 321                IdPropietario = _propietario.IdCliente,
 322                Tasa = _tasa,
 323                Saldo = 0
 324            };
 325        }
 26        public void Depositar(decimal monto)
 327        {
 328            if (monto <= 0)
 029                throw new Exception (ERROR_MONTO_MENOR_IGUAL_A_CERO);
 330            Saldo += monto;
 331        }
 32        public void Retirar(decimal monto)
 233        {
 234            if (monto <= 0)
 135                throw new Exception (ERROR_MONTO_MENOR_IGUAL_A_CERO);
 136            Saldo -= monto;
 137        }
 38    }
 39}