public async Task <JsonResult> GetConversion(DateTime conversionDate, string fromCurrency, decimal originalAmount, string toCurrency) { try { var useCase = new GetConversion(_repository); return(Json(await useCase.ExecuteAsync(conversionDate, fromCurrency, originalAmount, toCurrency))); } catch (Exception ex) { // TODO: Log.Error("api/Swea/GetConversion", ex); throw new ExchangeCalculatorException($"Error getting conversion from {originalAmount} {fromCurrency} to {toCurrency} for {conversionDate.ToSwedishDateString()}."); } }
public GetConversionTests() { _useCase = new GetConversion(new SweaMockRepository()); }