Ejemplo n.º 1
0
        public async Task <IActionResult> Calcular(
            [FromServices] CalculadoraJurosHandler handler,
            [SwaggerParameter(Required = true)][FromQuery] CalculoCommand command)
        {
            var result = await handler.Calcular(command);

            return(Ok(result));
        }
Ejemplo n.º 2
0
 public void Calcular_QuandoCommandForNull_DeveLancarExcecao()
 {
     handler.Calcular(null).Should();
     handler.Invoking(x => x.Calcular(null))
     .Should().ThrowExactly <ArgumentNullException>();
 }