public async Task Testa_Tipo_Retorno_CalculaJuros_Erro_Validacao()
        {
            var mediator = GetIMediator();

            mediator.Setup(m => m.Send(It.IsAny <CalculaJurosCommand>(), It.IsAny <CancellationToken>()))
            .Returns(Task.FromException <double>(new ValidationException("Validate Exception!")));

            var controller = new CalculadoraController(_defaultSettings.Object, mediator.Object);

            ActionResult <double> result = await controller.CalculaJuros(_calculaJurosDto);

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Result);
            Assert.IsInstanceOfType(result.Result, typeof(BadRequestObjectResult));
        }
        public async Task Testa_Tipo_Retorno_CalculaJuros_Erro_Interno()
        {
            var mediator = GetIMediator();

            mediator.Setup(m => m.Send(It.IsAny <CalculaJurosCommand>(), It.IsAny <CancellationToken>()))
            .Returns(Task.FromException <double>(new Exception("Unhandled Exception!")));

            var controller = new CalculadoraController(_defaultSettings.Object, mediator.Object);

            ActionResult <double> result = await controller.CalculaJuros(_calculaJurosDto);

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Result);
            Assert.IsInstanceOfType(result.Result, typeof(ObjectResult));
            Assert.AreEqual((result.Result as ObjectResult).StatusCode, (int)HttpStatusCode.InternalServerError);
        }
        public async Task Testa_Tipo_Retorno_CalculaJuros_OK()
        {
            var value = 105.1;

            var mediator = GetIMediator();

            mediator.Setup(m => m.Send(It.IsAny <CalculaJurosCommand>(), It.IsAny <CancellationToken>()))
            .Returns(Task.FromResult <double>(value));

            var controller = new CalculadoraController(_defaultSettings.Object, mediator.Object);

            ActionResult <double> result = await controller.CalculaJuros(_calculaJurosDto);

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Result);
            Assert.IsInstanceOfType(result.Result, typeof(OkObjectResult));
            Assert.AreEqual((result.Result as OkObjectResult).Value, value);
        }