public void ConsigoSelecionarTaxaDeJuros() { ITaxaJurosServico taxaJurosServico = new TaxaJurosServico(); TaxaJurosDTO taxaJurosDTO = taxaJurosServico.ObterTaxaJuros(); Assert.NotNull(taxaJurosDTO); Assert.True(taxaJurosDTO.TaxaJuros > 0); }
public CalculoJurosDTO(double valorInicial, int meses, TaxaJurosDTO taxaJurosDTO) { if (valorInicial <= 0) { throw new ArgumentOutOfRangeException("valorInicial", "Valor inicial deve ser maior que zero"); } if (meses < 0) { throw new ArgumentOutOfRangeException("meses", "Quantidade de meses deve ser maior que zero"); } TaxaJurosDTO = taxaJurosDTO ?? throw new ArgumentNullException("TaxaJurosDTO"); ValorInicial = valorInicial; Meses = meses; }
public void ConstrutorDevePreencherPropriedadesCorretamente() { TaxaJurosDTO config = new TaxaJurosDTO(0.01); Assert.Equal(0.01, config.TaxaJuros); }
public IActionResult Get([FromQuery] double valorInicial, [FromQuery] int meses) { TaxaJurosDTO taxaDTO = _ITaxaJurosServico.ObterTaxaJuros(); return(Ok(_ICalculoJurosServico.ObterValorCalculado(new CalculoJurosDTO(valorInicial, meses, taxaDTO)))); }