public void CalculaJurosServices_CalcularJurosComposto_Sucesso()
        {
            // Arrange
            ParametrosCalculoDTO parametrosCalculoDTO = new ParametrosCalculoDTO(100, 5);
            CalculaJurosServices CalculaJurosServices = new CalculaJurosServices();

            //Act
            var result = CalculaJurosServices.CalcularJurosComposto(parametrosCalculoDTO);

            //Assert
            Assert.Contains("105,10", result);
        }
        public void CalculaJurosServices_CalcularJurosComposto_NaoArredondarResultado()
        {
            // Arrange
            ParametrosCalculoDTO parametrosCalculoDTO = new ParametrosCalculoDTO(100, 8);
            CalculaJurosServices CalculaJurosServices = new CalculaJurosServices();

            //Act
            var result = CalculaJurosServices.CalcularJurosComposto(parametrosCalculoDTO);

            //Assert
            Assert.Contains("108,28", result);
        }
        public ActionResult <string> CalculaJuros(
            [FromQuery(Name = "valorinicial")] decimal pValorinicial,
            [FromQuery(Name = "meses")] int pMeses
            )
        {
            ParametrosCalculoDTO pParametrosCalculoDTO = new ParametrosCalculoDTO();

            pParametrosCalculoDTO.ValorInicial = pValorinicial;
            pParametrosCalculoDTO.Meses        = pMeses;

            if (String.IsNullOrEmpty(pParametrosCalculoDTO.ValidarParametros()))
            {
                CalculaJurosServices calculaJurosServices = new CalculaJurosServices();
                return(calculaJurosServices.CalcularJurosComposto(pParametrosCalculoDTO).ToString());
            }

            return(pParametrosCalculoDTO.ValidarParametros());
        }