コード例 #1
0
        public void CalculoJuro_CalcularMontante_DeveExecutarComSucesso(CalculaJuroFilter filter, double montanteEsperado, double taxaJuro)
        {
            var caluloJuro = new CalculaJuro.API.Business.CalculaJuro(valorInicial: filter.ValorInicial.Value, periodo: filter.Periodo.Value, taxaJuro: taxaJuro);

            var montante = caluloJuro.RealizarCalculo();

            montante.Should().Be(montanteEsperado);
        }
コード例 #2
0
        public async Task CalculoService_CalcularMontante_DeveBuscarTaxaJurosComErro(CalculaJuroFilter filtro)
        {
            // Arrange  Act
            var calculoService = new CalculoService(_bus, _taxaJuroAPI);
            var montante       = await calculoService.CalcularAsync(filtro);

            // Assert
            montante.Should().BeNull();
            await _bus.Received(1).Publish(Arg.Any <DomainNotification>());
        }
コード例 #3
0
 public async Task <IActionResult> BuscarTaxaJuros([FromQuery] CalculaJuroFilter filter)
 {
     return(Response(await _calculoService.CalcularAsync(filter)));
 }