public ActionResult <ConversionRespond> Get([FromQuery] ConversionRequest request) { try { var output = _converter.AmountToString(request.Amount); return(Ok(new ConversionRespond { Name = request.Name, AmountString = output })); } catch (Exception e) { // TODO log here // log... return(StatusCode(StatusCodes.Status500InternalServerError)); } }
public void AmountToStringTest(decimal input, string expected) { _converter.AmountToString(input).Should().Be(expected); }