예제 #1
0
        public void Calcular()
        {
            var command = new CalcularSeguroCommand()
            {
                CPF          = "00000000191",
                ValorVeiculo = 10000,
                Marca        = "Ford",
                Modelo       = "Fiesta"
            };

            CommandResult result = _handler.Calcular(command);

            Assert.AreNotEqual(null, result);
            var seguro = result.Value as Seguro;

            Assert.AreEqual(seguro.Valor, Decimal.Parse("270,37"));
        }
        public IActionResult Calcular([FromBody] CalcularSeguroCommand command)
        {
            var result = (CommandResult)_handler.Calcular(command);

            return(Ok(result.Value));
        }