public decimal CalculaImpostoDeRenda(Salario salario) { if (DeveUsarTaxaNoSalario(salario)) { return(AplicaTaxaImpostoDeRenda(salario)); } else { return(salario.SalarioTotal()); } }
protected override bool DeveUsarTaxaNoSalario(Salario salario) => salario.SalarioTotal() >= 1903.99M && salario.SalarioTotal() <= 2826.65M;
protected override decimal AplicaTaxaImpostoDeRenda(Salario salario) => salario.SalarioTotal() - 142.80M;
protected override bool DeveUsarTaxaNoSalario(Salario salario) => salario.SalarioTotal() >= 2826.66M && salario.SalarioTotal() <= 3751.05M;
protected override bool DeveUsarTaxaNoSalario(Salario salario) => salario.SalarioTotal() >= 3751.06M && salario.SalarioTotal() <= 4664.68M;
protected override bool DeveUsarTaxaNoSalario(Salario salario) => salario.SalarioTotal() <= 1903.99M;