Пример #1
0
        public void TestaCalculoTaxaDeJurosValorPadrao()
        {
            var defaultValue = "105.10";
            var taxaDeJurosRepositoryMock = new Mock <ITaxaDeJurosRepository>();
            var taxaDeJurosHelperMOck     = new Mock <ITaxaDeJurosHelper>();

            taxaDeJurosHelperMOck.Setup(x => x.GetTaxaDeJuros()).Returns(Task.FromResult(0.01m));

            var taxaDeJurosService = new TaxaDeJurosService(taxaDeJurosHelperMOck.Object, taxaDeJurosRepositoryMock.Object);

            var result = taxaDeJurosService.CalculaTaxaDeJuros(new Model.API.TaxaJuros.CalculoTaxaDeJurosRequest()
            {
                Meses        = 5,
                ValorInicial = 100
            }).Result;

            Assert.Equal(defaultValue, result.ValorCalculado);
        }
        public ActionResult <IEnumerable <decimal> > Get()
        {
            var service = new TaxaDeJurosService();

            return(Ok(service.GetValorTaxaDeJuros()));
        }
 public void OneTimeSetUp()
 {
     _service = new TaxaDeJurosService();
 }